From 3a4a3079ce44dfde45f4b584dc48c3175b516b21 Mon Sep 17 00:00:00 2001 From: ubbo Date: Mon, 10 May 2010 09:44:53 +0000 Subject: open file if provided from command-line git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@317 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- gpgwin.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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() -- cgit v1.2.3