[yast-commit] r60038 - in /trunk/control-center: package/yast2-control-center.changes src/yqdesktopfilesmodel.cpp
Author: kmachalkova Date: Thu Dec 10 13:32:00 2009 New Revision: 60038 URL: http://svn.opensuse.org/viewcvs/yast?rev=60038&view=rev Log: Show GenericNames with comma Modified: trunk/control-center/package/yast2-control-center.changes trunk/control-center/src/yqdesktopfilesmodel.cpp Modified: trunk/control-center/package/yast2-control-center.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center/package/yast2-cont... ============================================================================== --- trunk/control-center/package/yast2-control-center.changes (original) +++ trunk/control-center/package/yast2-control-center.changes Thu Dec 10 13:32:00 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Dec 10 13:03:24 CET 2009 - kmachalkova@suse.cz + +- Show correctly GenericNames containing comma (convert QStringList + to QString) (bnc#550085) + +------------------------------------------------------------------- Mon Nov 23 16:30:53 CET 2009 - kmachalkova@suse.cz - Use 'YaST' instead of 'YaST2' in messages and window titlebars Modified: trunk/control-center/src/yqdesktopfilesmodel.cpp URL: http://svn.opensuse.org/viewcvs/yast/trunk/control-center/src/yqdesktopfiles... ============================================================================== --- trunk/control-center/src/yqdesktopfilesmodel.cpp (original) +++ trunk/control-center/src/yqdesktopfilesmodel.cpp Thu Dec 10 13:32:00 2009 @@ -228,16 +228,37 @@ { QString fname = d->desktop_files.value( index.row() ); QFileInfo fi(fname); - QString value = propertyValue(index, key).toString(); + QVariant value = propertyValue(index, key); + QString valueAsString = ""; + + // We can get QString, as well as QStringList if the .desktop key is csv + // (Qt's being too smart here and converts csv automatically to QStringList + // unless it's quoted). I'm not really happy about this solution, would be + // better to enforce quoting csv, but .desktop standard does not enforce + // quoting either (bnc#550085) + switch( value.type()) + { + case QVariant::String: { + valueAsString = value.toString(); + break; + } + case QVariant::StringList: { + valueAsString = value.toStringList().join(", "); + break; + } + default: + break; + } + QString msgid = QString( "%1(%2)" ).arg( key, fi.fileName() ); msgid += ": "; - msgid += value; + msgid += valueAsString; QString msgstr = QString::fromUtf8( dgettext ( DESKTOP_TRANSLATIONS, msgid.toAscii()) ); if( msgid == msgstr) - return value; + return valueAsString; else return msgstr; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kmachalkova@svn.opensuse.org