summaryrefslogtreecommitdiff
authorerik <erik>2007-01-19 01:15:31 (UTC)
committer erik <erik>2007-01-19 01:15:31 (UTC)
commitac0ce844e90a64247c0adb210e0a23021b011d57 (patch) (side-by-side diff)
tree1fd3b8d0c24d8f2054ed45e7e2e102f940343462
parent1ab92f1d2b346de7da8ca5c3aaa6bc75b43981e7 (diff)
downloadopie-ac0ce844e90a64247c0adb210e0a23021b011d57.zip
opie-ac0ce844e90a64247c0adb210e0a23021b011d57.tar.gz
opie-ac0ce844e90a64247c0adb210e0a23021b011d57.tar.bz2
Commit of Paul's patch to remove a macro and substitute it with a
class variable.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp16
-rw-r--r--library/qpeapplication.h2
-rw-r--r--library/widget_showing.cpp9
3 files changed, 15 insertions, 12 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index dcc1001..34f5e6a 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -101,6 +101,7 @@
static bool useBigPixmaps = 0;
+static bool saveWindowsPos = 0;
class HackWidget : public QWidget
{
@@ -129,6 +130,7 @@ public:
fontSize = cfg.readNumEntry( "FontSize", 10 );
smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 );
bigIconSize = cfg.readNumEntry( "BigIconSize", 32 );
+ saveWindowsPos = cfg.readBoolEntry( "AllowWindowed", false );
#ifdef OPIE_WITHROHFEEDBACK
RoH = 0;
#endif
@@ -250,7 +252,8 @@ public:
static bool read_widget_rect(const QString &app, bool &maximized, QPoint &p, QSize &s)
{
-#ifndef OPIE_NO_WINDOWED
+ if (!saveWindowsPos)
+ return FALSE;
maximized = TRUE;
// 350 is the trigger in qwsdefaultdecoration for providing a resize button
if ( qApp->desktop()->width() <= 350 )
@@ -272,8 +275,6 @@ public:
return TRUE;
}
-#endif
- return FALSE;
}
@@ -322,7 +323,8 @@ public:
{
if( !w )
return;
-#ifndef OPIE_NO_WINDOWED
+ if (!saveWindowsPos)
+ return;
// 350 is the trigger in qwsdefaultdecoration for providing a resize button
if ( qApp->desktop()->width() <= 350 )
return;
@@ -343,7 +345,6 @@ public:
QString s;
s.sprintf("%d,%d,%d,%d,%d", r.left() + offsetX, r.top() + offsetY, r.width(), r.height(), w->isMaximized() );
cfg.writeEntry( app, s );
-#endif
}
static bool setWidgetCaptionFromAppName( QWidget* /*mw*/, const QString& /*appName*/, const QString& /*appsPath*/ )
@@ -2207,6 +2208,11 @@ void QPEApplication::hideOrQuit()
quit();
}
+bool QPEApplication::isSaveWindowsPos()
+{
+ return saveWindowsPos;
+}
+
#if (__GNUC__ > 2 ) && !defined(_OS_MACX_)
extern "C" void __cxa_pure_virtual();
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 6486cad..7c99a9a 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -137,6 +137,8 @@ public:
int exec();
+ static bool isSaveWindowsPos();
+
signals:
void clientMoused();
void timeChanged();
diff --git a/library/widget_showing.cpp b/library/widget_showing.cpp
index e43a16a..cc1bfb2 100644
--- a/library/widget_showing.cpp
+++ b/library/widget_showing.cpp
@@ -52,13 +52,8 @@ void QPEApplication::showWidget( QWidget* wg, bool nomax ) {
return;
}
-#ifdef OPIE_NO_WINDOWED
- Q_UNUSED( nomax )
- if ( TRUE ) {
-#else
- if ( !nomax
- && ( qApp->desktop()->width() <= 320 ) ){
-#endif
+ if ( !isSaveWindowsPos() || (!nomax
+ && ( qApp->desktop()->width() <= 30 )) ){
wg->showMaximized();
} else {
#ifdef Q_WS_QWS