aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-01-19 22:06:50 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-01-19 22:06:50 +0000
commit48441b291c4dd3290ed0e45aa636e58e0473cf85 (patch)
tree7f55a18bbca4e6f6a6de9112600105184f8de765
parentuse ressource file for all icons and remove iconpath (diff)
downloadgpg4usb-48441b291c4dd3290ed0e45aa636e58e0473cf85.tar.gz
gpg4usb-48441b291c4dd3290ed0e45aa636e58e0473cf85.zip
added file.close for every file.open
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@767 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--TODO8
-rw-r--r--attachments.cpp3
-rwxr-xr-xfileencryptiondialog.cpp6
-rw-r--r--keylist.cpp1
-rwxr-xr-xkeymgmt.cpp2
-rw-r--r--main.cpp2
-rw-r--r--textedit.cpp5
7 files changed, 13 insertions, 14 deletions
diff --git a/TODO b/TODO
index ac65207..90a4ffb 100644
--- a/TODO
+++ b/TODO
@@ -17,6 +17,8 @@ Release 0.3.2
- put quote and double line break removale to "special edit" operation toolbar (icons for double linebreaks missing) [DONE]
- emit keydbchanged from GPGcontext::importKey (for the moment not possible, because importinformation is lost after this) [DONE]
- fix translation file for "SettingsDialog" as it says two times English, and the comment is on the wrong one. [DONE]
+- remove iconpath and use ressource file instead [DONE]
+- restart gpg4usb on language change [DONE]
- Change "remove double line breaks" to "remove spacing" [DONE]
- icon from "line spacing icon" [DONE]
- key import should be more verbose: [DONE]
@@ -38,21 +40,15 @@ Release 0.3.2
- Add buttonto copy fingerprint to clipboard in details dialog [DONE]
- or set margin to make it easier selectable [DONE]
- remove whitespaces on copy [DONE]
-- restart gpg4usb on language change [DONE]
- fix cancel password entry bug on windows [DONE]
- Update Qt to 4.8 [DONE]
- add Qt language files for Qt locales
-- Wizard on first start (Create Key, Import from keys older gpg4usb, import from gnupg) [DONE]
- - import conf from old gpg4usb [DONE]
- - finalize
- investigate in adding a offline help system [DONE]
- have a look at the format
- images should be included in paragraph [DONE]
- every html should have prev, next, toc link
- remove menu and logo from subpages
- docs for sign&verify
-- add file.close, when files are opened
-- remove iconpath and use ressource file instaed
BUGS:
- import key toolbar dropdown shows text, even if only icon should be shown
diff --git a/attachments.cpp b/attachments.cpp
index 82c2e6a..8158da6 100644
--- a/attachments.cpp
+++ b/attachments.cpp
@@ -127,6 +127,7 @@ void Attachments::saveByteArrayToFile(QByteArray outBuffer, QString filename)
QDataStream out(&outfile);
out.writeRawData(outBuffer.data(), outBuffer.length());
+ outfile.close();
}
/**
@@ -171,7 +172,7 @@ void Attachments::openFile() {
QDataStream out(&outfile);
out.writeRawData(outBuffer.data(), outBuffer.length());
-
+ outfile.close();
QDesktopServices::openUrl(QUrl("file://"+filename, QUrl::TolerantMode));
}
diff --git a/fileencryptiondialog.cpp b/fileencryptiondialog.cpp
index 94ed540..0e1ec8b 100755
--- a/fileencryptiondialog.cpp
+++ b/fileencryptiondialog.cpp
@@ -37,7 +37,6 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::GpgContext *ctx, QStringList k
resize(500, 200);
}
-
setModal(true);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
@@ -156,8 +155,7 @@ void FileEncryptionDialog::executeAction()
QByteArray inBuffer = infile.readAll();
QByteArray *outBuffer = new QByteArray();
-
-
+ infile.close();
if ( mAction == Encrypt || (mAction == Both && radioEnc->isChecked())) {
if (! mCtx->encrypt(mKeyList->getChecked(), inBuffer, outBuffer)) return;
}
@@ -187,7 +185,9 @@ void FileEncryptionDialog::executeAction()
QDataStream out(&outfile);
out.writeRawData(outBuffer->data(), outBuffer->length());
+ outfile.close();
QMessageBox::information(0, "Done", "Output saved to " + outputFileEdit->text());
+
accept();
}
diff --git a/keylist.cpp b/keylist.cpp
index 791bd0b..3d93433 100644
--- a/keylist.cpp
+++ b/keylist.cpp
@@ -235,6 +235,7 @@ void KeyList::dropEvent(QDropEvent* event)
}
QByteArray inBuffer = file.readAll();
this->importKeys(inBuffer);
+ file.close();
}
} else {
QByteArray inBuffer(event->mimeData()->text().toUtf8());
diff --git a/keymgmt.cpp b/keymgmt.cpp
index fe5c521..20d9784 100755
--- a/keymgmt.cpp
+++ b/keymgmt.cpp
@@ -171,8 +171,8 @@ void KeyMgmt::importKeyFromFile()
qDebug() << tr("Couldn't Open File: ") + fileName;
}
QByteArray inBuffer = file.readAll();
-
importKeys(inBuffer);
+ file.close();
}
}
diff --git a/main.cpp b/main.cpp
index c2380d3..232d434 100644
--- a/main.cpp
+++ b/main.cpp
@@ -79,7 +79,7 @@ int main(int argc, char *argv[])
file.open(QFile::ReadOnly);
QString styleSheet = QLatin1String(file.readAll());
qApp->setStyleSheet(styleSheet);
-
+ file.close();
/**
* internationalisation. loop to restart mainwindow
diff --git a/textedit.cpp b/textedit.cpp
index d847998..9799992 100644
--- a/textedit.cpp
+++ b/textedit.cpp
@@ -85,6 +85,7 @@ void TextEdit::open()
page->getTextPage()->setFocus();
connect(page->getTextPage()->document(), SIGNAL(modificationChanged(bool)), this, SLOT(showModified()));
//enableAction(true)
+ file.close();
} else {
QMessageBox::warning(this, tr("Application"),
tr("Cannot read file %1:\n%2.")
@@ -135,7 +136,7 @@ bool TextEdit::saveFile(const QString &fileName)
tabWidget->setTabText(curIndex, strippedName(fileName));
page->setFilePath(fileName);
// statusBar()->showMessage(tr("File saved"), 2000);
-
+ file.close();
return true;
} else {
QMessageBox::warning(this, tr("File"),
@@ -386,7 +387,7 @@ void TextEdit::loadFile(const QString &fileName)
QApplication::restoreOverrideCursor();
curPage()->setFilePath(fileName);
tabWidget->setTabText(tabWidget->currentIndex(), strippedName(fileName));
-
+ file.close();
// statusBar()->showMessage(tr("File loaded"), 2000);
}