[BeFree CVS] neptune/libneptune-xdg ChangeLog,1.11,1.12 bicontheme.cpp,1.11,1.12
Status: Planning
Brought to you by:
plfiorini
|
From: Pier L. F. <plf...@us...> - 2005-01-07 03:09:31
|
Update of /cvsroot/befree/neptune/libneptune-xdg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6873 Modified Files: ChangeLog bicontheme.cpp Log Message: First check for icons in datadir/pixmaps/ Index: bicontheme.cpp =================================================================== RCS file: /cvsroot/befree/neptune/libneptune-xdg/bicontheme.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- bicontheme.cpp 3 Jan 2005 00:17:28 -0000 1.11 +++ bicontheme.cpp 7 Jan 2005 03:09:21 -0000 1.12 @@ -275,17 +275,36 @@ QIcon BIconTheme::loadIcon(const QString &name, Qt::IconSize size, BIconTheme::Context dircontext) { + QStringList dataDirs = BBaseDirectory::dataDirectories(); + bool found = false; + QString path; Q_INT32 iconsize; QIcon icon; - // Determine icon size - if (size == Qt::SmallIconSize) - iconsize = BConfiguration::smallIconSize(); - else - iconsize = BConfiguration::largeIconSize(); + // Check if the icon is available out of the icon theme + for (int i = 0; i < dataDirs.size(); ++i) + { + QFileInfo info(dataDirs.at(i) + "/pixmaps/" + name + ".png"); - // Get icon path - QString path = iconPath(name, iconsize, dircontext); + if (info.exists()) + { + found = true; + path = info.absoluteFilePath(); + break; + } + } + + if (!found) + { + // Determine icon size + if (size == Qt::SmallIconSize) + iconsize = BConfiguration::smallIconSize(); + else + iconsize = BConfiguration::largeIconSize(); + + // Get icon path + path = iconPath(name, iconsize, dircontext); + } // Set icon if found if (!path.isEmpty()) Index: ChangeLog =================================================================== RCS file: /cvsroot/befree/neptune/libneptune-xdg/ChangeLog,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChangeLog 1 Jan 2005 21:05:48 -0000 1.11 +++ ChangeLog 7 Jan 2005 03:09:21 -0000 1.12 @@ -1,3 +1,8 @@ +2005-01-07 Pier Luigi Fiorini <pie...@mo...> + + * bicontheme.cpp (BIconTheme::loadIcon): Check for icons in + datadir/pixmaps/ first. + 2005-01-01 Pier Luigi Fiorini <pie...@mo...> * bbasedirectory.{cpp,h}: Updated with specification 0.6. |