Author: kmachalkova Date: Tue Jun 9 15:30:31 2009 New Revision: 57514 URL: http://svn.opensuse.org/viewcvs/yast?rev=57514&view=rev Log: Moving addDesktopFilesPath out of base class ctor so it can be overloaded Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/models_test.cpp branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.cpp branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.h branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulegroupsmodel.cpp branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.cpp branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.h Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/models_test.cpp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewrite/src/models_test.cpp?rev=57514&r1=57513&r2=57514&view=diff ============================================================================== --- branches/tmp/tgoettlicher/yast2cc_rewrite/src/models_test.cpp (original) +++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/models_test.cpp Tue Jun 9 15:30:31 2009 @@ -8,8 +8,9 @@ { QApplication app(argc, argv); QListView window; - YQDesktopFilesModel model("/usr/share/applications/YaST2/groups", &window); + YQDesktopFilesModel model(&window); model.addIconPath("/usr/share/YaST2/theme/current/icons/32x32/apps"); + model.addDesktopFilesPath("/usr/share/applications/YaST2/groups"); window.setModel(&model); window.show(); Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.cpp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.cpp?rev=57514&r1=57513&r2=57514&view=diff ============================================================================== --- branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.cpp (original) +++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.cpp Tue Jun 9 15:30:31 2009 @@ -19,14 +19,13 @@ #define DESKTOP_TRANSLATIONS "desktop_translations" -YQDesktopFilesModel::YQDesktopFilesModel( const QString &dir, QObject * parent ) +YQDesktopFilesModel::YQDesktopFilesModel( QObject * parent ) : QAbstractItemModel(parent) , d(new Private) { connect(&d->watcher, SIGNAL(directoryChanged(const QString &)), SLOT(slotDesktopFilesDirectoryChanged( const QString & ) ) ); - addDesktopFilesPath(dir); bindtextdomain( DESKTOP_TRANSLATIONS, DESKTOP_TRANSLATIONS_DIR ); bind_textdomain_codeset( DESKTOP_TRANSLATIONS, "utf8" ); @@ -84,7 +83,7 @@ /** * read a YaST group .desktop file */ -PropertyMap readDesktopFile( const QString &filename ) +PropertyMap YQDesktopFilesModel::readDesktopFile( const QString &filename ) { // desktop file data PropertyMap data; Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.h?rev=57514&r1=57513&r2=57514&view=diff ============================================================================== --- branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.h (original) +++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqdesktopfilesmodel.h Tue Jun 9 15:30:31 2009 @@ -50,13 +50,13 @@ RootOnly }; - YQDesktopFilesModel( const QString &dir, QObject * parent = 0 ); + YQDesktopFilesModel( QObject * parent = 0 ); ~YQDesktopFilesModel(); /** * Add a directory where Desktop files will be searched */ - void addDesktopFilesPath( const QString &dir ); + void addDesktopFilesPath( const QString & dir ); /** * Add a directory where to look for icons @@ -88,13 +88,14 @@ virtual QModelIndex parent( const QModelIndex & index ) const; - void addDesktopFile(QString &fname); + void addDesktopFile( QString &fname); void addDesktopFiles( QStringList &flist); void addPropertyToDesktopFile( QString &fname, const QString &key, QString &value ); protected: void readDesktopFilesDirectories(); void readDesktopFiles(); + virtual PropertyMap readDesktopFile( const QString &path ); class Private { public: @@ -122,6 +123,7 @@ protected slots: void slotDesktopFilesDirectoryChanged( const QString &path ); + }; #endif Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulegroupsmodel.cpp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulegroupsmodel.cpp?rev=57514&r1=57513&r2=57514&view=diff ============================================================================== --- branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulegroupsmodel.cpp (original) +++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulegroupsmodel.cpp Tue Jun 9 15:30:31 2009 @@ -30,8 +30,9 @@ }; YQModuleGroupsModel::YQModuleGroupsModel( QObject * parent ) - : YQDesktopFilesModel( GROUPS_DESKTOP_DIR, parent) + : YQDesktopFilesModel(parent) { + addDesktopFilesPath( GROUPS_DESKTOP_DIR ); addIconPath("/usr/share/YaST2/theme/current/icons/32x32/apps"); addIconPath("/usr/share/icons/hicolor/32x32/apps"); reindex(); Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.cpp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.cpp?rev=57514&r1=57513&r2=57514&view=diff ============================================================================== --- branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.cpp (original) +++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.cpp Tue Jun 9 15:30:31 2009 @@ -10,6 +10,7 @@ \---------------------------------------------------------------------*/ #include <QDebug> +#include <QSettings> #include "yqmodulesmodel.h" #include "yqmodulesproxymodel.h" @@ -40,9 +41,10 @@ YQModulesModel::YQModulesModel( QObject * parent ) - : YQDesktopFilesModel( MODULES_DESKTOP_DIR, parent) + : YQDesktopFilesModel(parent) , priv(new Private) { + addDesktopFilesPath( MODULES_DESKTOP_DIR ); addIconPath("/usr/share/YaST2/theme/current/icons/32x32/apps"); addIconPath("/usr/share/icons/hicolor/32x32/apps"); } @@ -56,6 +58,15 @@ return priv->groupsModel; } +PropertyMap YQModulesModel::readDesktopFile( const QString &path ) +{ + qDebug() << "Bublincin pisecek" ; + PropertyMap data; + + return data; + +} + QModelIndex YQModulesModel::firstModuleInGroup( const QModelIndex &index ) const { // what is the name of that group? Modified: branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.h?rev=57514&r1=57513&r2=57514&view=diff ============================================================================== --- branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.h (original) +++ branches/tmp/tgoettlicher/yast2cc_rewrite/src/yqmodulesmodel.h Tue Jun 9 15:30:31 2009 @@ -39,6 +39,8 @@ YQModulesModel( QObject * parent = 0 ); ~YQModulesModel(); + virtual PropertyMap readDesktopFile( const QString &path ); + /** * reimplemented from YQDesktopFilesModel */ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org