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:
Thomas Frauendorfer 2008-11-02 11:52:49 +01:00
parent fbb7808c7f
commit 461106eb43
6 changed files with 22 additions and 18 deletions

4
README
View file

@ -1,4 +1,4 @@
Required dependencys: Required dependencies:
* QT4.2.x http://www.trolltech.no/ * QT4.2.x http://www.trolltech.no/
* XMMS2 http://xmms2.xmms.org/ * XMMS2 http://xmms2.xmms.org/
* XMMS2 C++ bindings (make sure you have boost_signals when compiling xmms2) * XMMS2 C++ bindings (make sure you have boost_signals when compiling xmms2)
@ -16,6 +16,8 @@ Compiling:
5) ???? 5) ????
6) profit 6) profit
To change the install directory, use 'qmake PREFIX=<path>' at step 1
Compilation problems: Compilation problems:
- Errormessage "WARNING: Found potential symbol conflict of <somefile>" - Errormessage "WARNING: Found potential symbol conflict of <somefile>"
-> make sure you use uic from Qt4 (uic -version) -> make sure you use uic from Qt4 (uic -version)

View file

@ -2,6 +2,3 @@ DEFINES += PROMOE_VERSION="\"\\\"0.1-dev\\\"\""
DEPENDPATH += $PWD/src $PWD/lib DEPENDPATH += $PWD/src $PWD/lib
INCLUDEPATH += $$PWD/src $$PWD/lib INCLUDEPATH += $$PWD/src $$PWD/lib
PREFIX = /usr/local
BINDIR = $$PREFIX/bin

View file

@ -4,6 +4,11 @@ SUBDIRS = lib src
include (config.pri) include (config.pri)
target.path = $$BINDIR isEmpty(PREFIX): PREFIX = /usr/local
target.files = promoe isEmpty(BINDIR): BINDIR = $$PREFIX/bin
INSTALLS += target
message ( "Install path set to:" $$PREFIX )
binarys.path = $$BINDIR
binarys.files = promoe
INSTALLS += binarys

View file

@ -71,10 +71,11 @@ Skin::setSkin (const QString& name)
} }
const QPixmap 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 */ /* check for files in zip and check if file exists */
QDir dir (path);
dir.setFilter (QDir::Files); dir.setFilter (QDir::Files);
QFileInfoList list = dir.entryInfoList(); QFileInfoList list = dir.entryInfoList();
@ -93,10 +94,10 @@ Skin::getPixmap (const QString& file, QDir dir)
const QPixmap const QPixmap
Skin::getPixmap (const QString& file) Skin::getPixmap (const QString& file)
{ {
QDir dir; /* QDir dir;
dir.setPath (m_path); dir.setPath (m_path);
/* dir.setFilter (QDir::Files); dir.setFilter (QDir::Files);
QFileInfoList list = dir.entryInfoList(); QFileInfoList list = dir.entryInfoList();
for (int i = 0; i < list.size(); ++i) { for (int i = 0; i < list.size(); ++i) {
@ -109,7 +110,7 @@ Skin::getPixmap (const QString& file)
return QPixmap (); return QPixmap ();
*/ */
return getPixmap (file, dir); return getPixmap (file, m_path);
} }
bool bool

View file

@ -37,7 +37,7 @@ class Skin : public QObject
static Skin *getInstance (void); static Skin *getInstance (void);
bool setSkin (const QString& name); 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 QSize getSize (uint item) const { return m_sizes[item]; };
const QPoint getPos (uint item) const { return m_positions[item]; }; const QPoint getPos (uint item) const { return m_positions[item]; };

View file

@ -63,20 +63,19 @@ SkinList::SkinList (QWidget *parent) : QListWidget (parent)
settings.setValue ("skin/searchpath", searchpath); settings.setValue ("skin/searchpath", searchpath);
} }
QFileInfoList list;
QDir d; QDir d;
d.setFilter (QDir::Dirs); d.setFilter (QDir::Dirs|QDir::NoDotAndDotDot);
QFileInfoList list;
foreach (QString path, searchpath) { foreach (QString path, searchpath) {
d.setPath (path); d.setPath (path);
list += d.entryInfoList(); list += d.entryInfoList();
} }
foreach (QFileInfo fileInfo, list) { foreach (QFileInfo fileInfo, list) {
QDir dir (fileInfo.filePath()); QPixmap p = Skin::getPixmap ("main", fileInfo.filePath());
QPixmap p = Skin::getPixmap ("main", dir);
if (!p.isNull()) { if (!p.isNull()) {
new SkinChooserItem (QIcon (p), dir.dirName(), dir.absolutePath(), new SkinChooserItem (QIcon (p), fileInfo.baseName (),
this); fileInfo.absoluteFilePath (), this);
} }
} }