OTHER: Change a Parameter from QDir to QString.
I think this will be needed when I add zipped skin support later
This commit is contained in:
parent
fbb7808c7f
commit
461106eb43
6 changed files with 22 additions and 18 deletions
|
@ -71,10 +71,11 @@ Skin::setSkin (const QString& name)
|
|||
}
|
||||
|
||||
const QPixmap
|
||||
Skin::getPixmap (const QString& file, QDir dir)
|
||||
Skin::getPixmap (const QString& file, const QString &path)
|
||||
{
|
||||
/* check for files in zip and check if file exists */
|
||||
|
||||
QDir dir (path);
|
||||
dir.setFilter (QDir::Files);
|
||||
|
||||
QFileInfoList list = dir.entryInfoList();
|
||||
|
@ -93,10 +94,10 @@ Skin::getPixmap (const QString& file, QDir dir)
|
|||
const QPixmap
|
||||
Skin::getPixmap (const QString& file)
|
||||
{
|
||||
QDir dir;
|
||||
/* QDir dir;
|
||||
|
||||
dir.setPath (m_path);
|
||||
/* dir.setFilter (QDir::Files);
|
||||
dir.setFilter (QDir::Files);
|
||||
|
||||
QFileInfoList list = dir.entryInfoList();
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
|
@ -109,7 +110,7 @@ Skin::getPixmap (const QString& file)
|
|||
|
||||
return QPixmap ();
|
||||
*/
|
||||
return getPixmap (file, dir);
|
||||
return getPixmap (file, m_path);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -37,7 +37,7 @@ class Skin : public QObject
|
|||
static Skin *getInstance (void);
|
||||
|
||||
bool setSkin (const QString& name);
|
||||
static const QPixmap getPixmap (const QString&, QDir);
|
||||
static const QPixmap getPixmap (const QString&, const QString&);
|
||||
|
||||
const QSize getSize (uint item) const { return m_sizes[item]; };
|
||||
const QPoint getPos (uint item) const { return m_positions[item]; };
|
||||
|
|
|
@ -63,20 +63,19 @@ SkinList::SkinList (QWidget *parent) : QListWidget (parent)
|
|||
settings.setValue ("skin/searchpath", searchpath);
|
||||
}
|
||||
|
||||
QFileInfoList list;
|
||||
QDir d;
|
||||
d.setFilter (QDir::Dirs);
|
||||
d.setFilter (QDir::Dirs|QDir::NoDotAndDotDot);
|
||||
QFileInfoList list;
|
||||
foreach (QString path, searchpath) {
|
||||
d.setPath (path);
|
||||
list += d.entryInfoList();
|
||||
}
|
||||
|
||||
foreach (QFileInfo fileInfo, list) {
|
||||
QDir dir (fileInfo.filePath());
|
||||
QPixmap p = Skin::getPixmap ("main", dir);
|
||||
QPixmap p = Skin::getPixmap ("main", fileInfo.filePath());
|
||||
if (!p.isNull()) {
|
||||
new SkinChooserItem (QIcon (p), dir.dirName(), dir.absolutePath(),
|
||||
this);
|
||||
new SkinChooserItem (QIcon (p), fileInfo.baseName (),
|
||||
fileInfo.absoluteFilePath (), this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue