projects
/
quick-widgets
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Restored overwriting paintEvent.
[quick-widgets]
/
main.cpp
diff --git
a/main.cpp
b/main.cpp
index
24a201f
..
5e99551
100644
(file)
--- a/
main.cpp
+++ b/
main.cpp
@@
-36,7
+36,13
@@
int main(int argc, char *argv[])
else
{
qDebug() << "Asking it to offer to create a new widget.";
else
{
qDebug() << "Asking it to offer to create a new widget.";
- app.sendMessage(APP_MESSAGE_ADDWIDGET);
+ QStringList result;
+ result = app.arguments().filter(".qml");
+ if (result.size() == 1 && QFile(result.last()).exists()) {
+ app.sendMessage(QFileInfo(result.last()).absoluteFilePath());
+ } else {
+ app.sendMessage(APP_MESSAGE_SETWIDGET);
+ }
return 0;
}
}
return 0;
}
}
@@
-54,13
+60,16
@@
int main(int argc, char *argv[])
qDebug() << "Restoring all widgets";
QeMaemo5DynamicWidgetHelper::globalInstance()->restoreWidgets<QuickWidget>();
}
qDebug() << "Restoring all widgets";
QeMaemo5DynamicWidgetHelper::globalInstance()->restoreWidgets<QuickWidget>();
}
-
- if (!app.arguments().contains("in-background"))
+ QStringList result;
+ result = app.arguments().filter(".qml");
+ if (result.size() == 1 && QFile(result.last()).exists()) {
+ app.sendMessage(QFileInfo(result.last()).absoluteFilePath());
+ } else if (!app.arguments().contains("in-background"))
{
// setting for new widget
QuickWidgetSettings settingsDialog;
settingsDialog.exec();
{
// setting for new widget
QuickWidgetSettings settingsDialog;
settingsDialog.exec();
- //app.sendMessage(APP_MESSAGE_ADDWIDGET);
+ //app.sendMessage(APP_MESSAGE_SETWIDGET);
}
return app.exec();
}
}
return app.exec();
}