summaryrefslogtreecommitdiff
path: root/library/qpedecoration_qws.cpp
Side-by-side diff
Diffstat (limited to 'library/qpedecoration_qws.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpedecoration_qws.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/library/qpedecoration_qws.cpp b/library/qpedecoration_qws.cpp
index 933542d..bac1a75 100644
--- a/library/qpedecoration_qws.cpp
+++ b/library/qpedecoration_qws.cpp
@@ -467,101 +467,109 @@ public:
*iface = this;
else if ( uuid == IID_WindowDecoration )
*iface = this;
if ( *iface )
(*iface)->addRef();
return QS_OK;
}
Q_REFCOUNT
private:
ulong ref;
};
static WindowDecorationInterface *wdiface = 0;
static QLibrary *wdlib = 0;
static QString libname;
//===========================================================================
QPEDecoration::QPEDecoration()
: QWSDefaultDecoration()
{
init ( libname );
}
QPEDecoration::QPEDecoration( const QString &plugin )
: QWSDefaultDecoration()
{
init ( plugin );
}
void QPEDecoration::init ( const QString &plugin )
{
libname = plugin;
if ( wdlib ) {
wdiface->release();
wdlib->unload();
delete wdlib;
wdlib = 0;
} else {
delete wdiface;
}
WindowDecorationInterface *iface = 0;
QString path = QPEApplication::qpeDir() + "/plugins/decorations/";
+#ifdef Q_OS_MACX
+ if ( plugin.find( ".dylib" ) > 0 ) {
+#else
if ( plugin.find( ".so" ) > 0 ) {
+#endif
// full library name supplied
path += plugin;
} else {
+#ifdef Q_OS_MACX
+ path += "lib" + plugin.lower() + ".dylib"; // compatibility
+#else
path += "lib" + plugin.lower() + ".so"; // compatibility
+#endif
}
QLibrary *lib = new QLibrary( path );
if ( lib->queryInterface( IID_WindowDecoration, (QUnknownInterface**)&iface ) == QS_OK && iface ) {
wdiface = iface;
wdlib = lib;
} else {
delete lib;
wdiface = new DefaultWindowDecoration;
}
helpFile = QString(qApp->argv()[0]) + ".html";
QStringList helpPath = Global::helpPath();
helpExists = FALSE;
for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it) {
helpExists = QFile::exists( *it + "/" + helpFile );
//qDebug ( "Checking %s/%s for help: %d", (*it).latin1(), helpFile.latin1(),helpExists);
}
qpeManager = new QPEManager( this );
// Qtopia 1.5 compatibility
imageOk = *okImage ( 15 );
imageClose = *closeImage ( 15 );
imageHelp = *helpImage ( 15 );
}
QPEDecoration::~QPEDecoration()
{
delete qpeManager;
}
const char **QPEDecoration::menuPixmap()
{
return (const char **)0;
}
const char **QPEDecoration::closePixmap()
{
return (const char **)qpe_close_xpm;
}
const char **QPEDecoration::minimizePixmap()
{
return (const char **)qpe_accept_xpm;
}
const char **QPEDecoration::maximizePixmap()
{