summaryrefslogtreecommitdiffstats
path: root/kruler/main.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-11-15 14:42:19 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-11-15 14:42:19 -0600
commit81e56a909befa0679332c6a22ae84c86e1d057ce (patch)
tree0b0548f32f23170dd3d9346f01b05f8a2f7f161a /kruler/main.cpp
parent8fb269b60c0938d1ce8a3912038ad8d7ce8a79e0 (diff)
downloadtdegraphics-81e56a909befa0679332c6a22ae84c86e1d057ce.tar.gz
tdegraphics-81e56a909befa0679332c6a22ae84c86e1d057ce.zip
Fix incorrect kruler orientation on session restore
Diffstat (limited to 'kruler/main.cpp')
-rw-r--r--kruler/main.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/kruler/main.cpp b/kruler/main.cpp
index 764e874c..196909a6 100644
--- a/kruler/main.cpp
+++ b/kruler/main.cpp
@@ -9,6 +9,17 @@
#include "klineal.h"
+#define RESTORE_RULERS(type) { \
+ int n = 1; \
+ while (KMainWindow::canBeRestored(n)) { \
+ type* ruler = new type; \
+ ruler->restore(n); \
+ a.setMainWidget(ruler); \
+ ruler->show(); \
+ n++; \
+ } \
+}
+
static const char homePageURL[] =
"http://www.snafu.de/~till/";
static const char freeFormText[] =
@@ -40,9 +51,14 @@ int main(int argc, char *argv[])
KApplication a;
- KLineal *ruler = new KLineal();
- a.setMainWidget(ruler);
- ruler->show();
+ if (a.isRestored()) {
+ RESTORE_RULERS(KLineal)
+ }
+ else {
+ KLineal *ruler = new KLineal();
+ a.setMainWidget(ruler);
+ ruler->show();
+ }
return a.exec();
}