comparison data/model/AudioSourceInfoModel.cpp @ 5:5cee0ce212a7

add easaier tab widgets, style and pass the layer characteristics in the main window (remove from panestack)
author lbajardsilogic
date Fri, 11 May 2007 14:03:48 +0000
parents
children ec2ca3fbd957
comparison
equal deleted inserted replaced
4:6409c107c57b 5:5cee0ce212a7
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /* Sound Access
4 EASAIER client application.
5 Silogic 2007. Laure Bajard.
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version. See the file
11 COPYING included with this distribution for more information.
12 */
13 #include "AudioSourceInfoModel.h"
14
15
16 AudioSourceInfoModel::AudioSourceInfoModel()
17 {}
18
19 AudioSourceInfoModel::~AudioSourceInfoModel()
20 {
21 m_info.clear();
22 }
23
24 void AudioSourceInfoModel::addInfo(QString proper, QString value)
25 {
26 m_info[proper.toLower()] = value;
27 }
28
29 QString AudioSourceInfoModel::getInfo(const QString& proper)
30 {
31 std::map<QString, QString>::iterator info;
32
33 info = m_info.find(proper.toLower());
34
35 if (info == m_info.end())
36 return "";
37
38 return (info->second);
39 }
40
41 QString AudioSourceInfoModel::getKey(const QString& value)
42 {
43 QString proper = "";
44
45 std::map<QString, QString>::iterator iter;
46
47 for (iter = m_info.begin(); iter != m_info.end(); iter++)
48 {
49 QString infoValue = iter->second;
50 if (infoValue == value)
51 {
52 proper = iter->first;
53 return proper;
54 }
55 }
56
57 return proper;
58 }