Lines 119-131
Link Here
|
119 |
|
119 |
|
120 |
if ( !ic->text().isEmpty() ) { |
120 |
if ( !ic->text().isEmpty() ) { |
121 |
// first, try to get the text by priorities |
121 |
// first, try to get the text by priorities |
122 |
QStringList lang; |
122 |
/* QStringList lang; |
123 |
lang << QString(QTextCodec::locale()).left(2); // most prioritent, is the local language |
123 |
lang << QString(QTextCodec::locale()).left(2); // most prioritent, is the local language |
124 |
lang << ""; // and then the language without name goes (international?) |
124 |
lang << ""; // and then the language without name goes (international?) |
125 |
lang << "en"; // then real English |
125 |
lang << "en"; // then real English |
126 |
|
126 |
*/ |
127 |
QString str; |
127 |
QString str; |
128 |
QStringList::Iterator it = lang.begin(); |
128 |
/* QStringList::Iterator it = lang.begin(); |
129 |
for ( ; it != lang.end(); ++it) { |
129 |
for ( ; it != lang.end(); ++it) { |
130 |
QHash<QString, QString>::const_iterator it2 = ic->text().find( *it ); |
130 |
QHash<QString, QString>::const_iterator it2 = ic->text().find( *it ); |
131 |
if ( it2 != ic->text().end() ) { |
131 |
if ( it2 != ic->text().end() ) { |
Lines 133-145
Link Here
|
133 |
break; |
133 |
break; |
134 |
} |
134 |
} |
135 |
} |
135 |
} |
136 |
|
136 |
*/ |
137 |
// if all fails, just get the first text |
137 |
// if all fails, just get the first text |
138 |
if ( str.isEmpty() ) |
138 |
if ( str.isEmpty() ) |
139 |
{ |
139 |
{ |
140 |
QHashIterator<QString, QString> it ( ic->text() ); |
140 |
QHashIterator<QString, QString> it ( ic->text() ); |
141 |
while ( it.hasNext() ) { |
141 |
it.toBack(); |
142 |
it.next(); |
142 |
while ( it.hasPrevious() ) { |
|
|
143 |
it.previous(); |
143 |
|
144 |
|
144 |
if ( !it.value().isEmpty() ) { |
145 |
if ( !it.value().isEmpty() ) { |
145 |
str = it.value(); |
146 |
str = it.value(); |
Lines 150-164
Link Here
|
150 |
|
151 |
|
151 |
if ( !str.isEmpty() ) |
152 |
if ( !str.isEmpty() ) |
152 |
text = str; |
153 |
text = str; |
153 |
|
|
|
154 |
// and list of possible variants in the ToolTip |
154 |
// and list of possible variants in the ToolTip |
155 |
QString toolTip; |
155 |
QString toolTip = text; |
156 |
foreach ( QString icText, ic->text() ) { |
156 |
/* foreach ( QString icText, ic->text() ) { |
157 |
if ( !toolTip.isEmpty() ) |
157 |
if ( !toolTip.isEmpty() ) |
158 |
toolTip += ", "; |
158 |
toolTip += ", "; |
159 |
toolTip += icText; |
159 |
toolTip += icText; |
160 |
break; // comment this to get list of iconsets |
160 |
break; // comment this to get list of iconsets |
161 |
} |
161 |
}*/ |
162 |
if ( toolTip.length() > 30 ) |
162 |
if ( toolTip.length() > 30 ) |
163 |
toolTip = toolTip.left(30) + "..."; |
163 |
toolTip = toolTip.left(30) + "..."; |
164 |
setToolTip(toolTip); |
164 |
setToolTip(toolTip); |