aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2010-05-10 09:44:53 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2010-05-10 09:44:53 +0000
commit3a4a3079ce44dfde45f4b584dc48c3175b516b21 (patch)
tree3f16751be485ae2d50d6b82aa2ed4eaf94856a61
parentadd testfile for multipart-attachments (diff)
downloadgpg4usb-3a4a3079ce44dfde45f4b584dc48c3175b516b21.tar.gz
gpg4usb-3a4a3079ce44dfde45f4b584dc48c3175b516b21.zip
open file if provided from command-line
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@317 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--gpgwin.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gpgwin.cpp b/gpgwin.cpp
index d88f6a8..1882827 100644
--- a/gpgwin.cpp
+++ b/gpgwin.cpp
@@ -58,6 +58,16 @@ GpgWin::GpgWin()
mKeyList->addMenuAction(appendSelectedKeysAct);
restoreSettings();
+
+ // open filename if provided as first command line parameter
+ QStringList args = qApp->arguments();
+ if(args.size() > 1) {
+ if(!args[1].startsWith("-")) {
+ if(QFile::exists(args[1]))
+ loadFile(args[1]);
+ }
+ }
+
}
void GpgWin::restoreSettings()