[yast-commit] r57285 - in /branches/tmp/tgoettlicher/yast2cc_rewrite/src: yqdesktopfilesmodel.cpp yqdesktopfilesmodel.h

Author: kmachalkova Date: Thu May 21 10:39:15 2009 New Revision: 57285 URL: http://svn.opensuse.org/viewcvs/yast?rev=57285&view=rev Log: Some helper functions Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.cpp branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.h Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.cpp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewri... ============================================================================== --- branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.cpp (original) +++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.cpp Thu May 21 10:39:15 2009 @@ -266,4 +266,26 @@ return QModelIndex(); } +void YQDesktopFilesModel::addDesktopFile( QString &fname ) +{ + d->desktop_files.push_front( fname ); +} + +void YQDesktopFilesModel::addDesktopFiles( QStringList &flist ) +{ + QStringListIterator it( flist ); + while (it.hasNext()) + { + QString one_string(it.next()); + addDesktopFile( one_string); + } +} + +void YQDesktopFilesModel::addPropertyToDesktopFile( QString &fname, QString &key, QString &value) +{ + if (d->cache.find( fname ) != d->cache.end()) + { + d->cache[ fname ].insert( key, value ); + } +} #include "yqdesktopfilesmodel.moc" Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewri... ============================================================================== --- branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.h (original) +++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.h Thu May 21 10:39:15 2009 @@ -83,6 +83,11 @@ virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder ); virtual QModelIndex parent( const QModelIndex & index ) const; + + void addDesktopFile(QString &fname); + void addDesktopFiles( QStringList &flist); + void addPropertyToDesktopFile( QString &fname, QString &key, QString &value ); + protected: void readDesktopFilesDirectories(); void readDesktopFiles(); -- 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