|
|
@ -632,16 +632,16 @@ bool KMyMoneyView::readFile(const KURL& url)
|
|
|
|
::timetrace("detected GPG");
|
|
|
|
::timetrace("detected GPG");
|
|
|
|
if(KGPGFile::GPGAvailable()) {
|
|
|
|
if(KGPGFile::GPGAvailable()) {
|
|
|
|
::timetrace("have GPG");
|
|
|
|
::timetrace("have GPG");
|
|
|
|
qfile = TQT_TQIODEVICE(new KGPGFile(filename));
|
|
|
|
qfile = new KGPGFile(filename);
|
|
|
|
haveAt = false;
|
|
|
|
haveAt = false;
|
|
|
|
isEncrypted = true;
|
|
|
|
isEncrypted = true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
KMessageBox::sorry(this, TQString("<qt>%1</qt>"). arg(i18n("GPG is not available for decryption of file <b>%1</b>").arg(filename)));
|
|
|
|
KMessageBox::sorry(this, TQString("<qt>%1</qt>"). arg(i18n("GPG is not available for decryption of file <b>%1</b>").arg(filename)));
|
|
|
|
qfile = TQT_TQIODEVICE(new TQFile(file.name()));
|
|
|
|
qfile = new TQFile(file.name());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// we can't use file directly, as we delete qfile later on
|
|
|
|
// we can't use file directly, as we delete qfile later on
|
|
|
|
qfile = TQT_TQIODEVICE(new TQFile(file.name()));
|
|
|
|
qfile = new TQFile(file.name());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
::timetrace("open file");
|
|
|
|
::timetrace("open file");
|
|
|
@ -969,7 +969,7 @@ bool KMyMoneyView::initializeStorage()
|
|
|
|
|
|
|
|
|
|
|
|
void KMyMoneyView::saveToLocalFile(TQFile* qfile, IMyMoneyStorageFormat* pWriter, bool plaintext, const TQString& keyList)
|
|
|
|
void KMyMoneyView::saveToLocalFile(TQFile* qfile, IMyMoneyStorageFormat* pWriter, bool plaintext, const TQString& keyList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQIODevice *dev = TQT_TQIODEVICE(qfile);
|
|
|
|
TQIODevice *dev = qfile;
|
|
|
|
KFilterBase *base = 0;
|
|
|
|
KFilterBase *base = 0;
|
|
|
|
TQIODevice *statusDevice = dev;
|
|
|
|
TQIODevice *statusDevice = dev;
|
|
|
|
|
|
|
|
|
|
|
@ -1027,7 +1027,7 @@ void KMyMoneyView::saveToLocalFile(TQFile* qfile, IMyMoneyStorageFormat* pWriter
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MyMoneyFile::instance()->setValue("kmm-encryption-key", keyList);
|
|
|
|
MyMoneyFile::instance()->setValue("kmm-encryption-key", keyList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
statusDevice = dev = TQT_TQIODEVICE(kgpg);
|
|
|
|
statusDevice = dev = kgpg;
|
|
|
|
if(!dev || !dev->open(IO_WriteOnly)) {
|
|
|
|
if(!dev || !dev->open(IO_WriteOnly)) {
|
|
|
|
MyMoneyFile::instance()->blockSignals(blocked);
|
|
|
|
MyMoneyFile::instance()->blockSignals(blocked);
|
|
|
|
delete dev;
|
|
|
|
delete dev;
|
|
|
@ -1039,7 +1039,7 @@ void KMyMoneyView::saveToLocalFile(TQFile* qfile, IMyMoneyStorageFormat* pWriter
|
|
|
|
base = KFilterBase::findFilterByMimeType( COMPRESSION_MIME_TYPE );
|
|
|
|
base = KFilterBase::findFilterByMimeType( COMPRESSION_MIME_TYPE );
|
|
|
|
if(base) {
|
|
|
|
if(base) {
|
|
|
|
qfile->close();
|
|
|
|
qfile->close();
|
|
|
|
base->setDevice(TQT_TQIODEVICE(qfile), false);
|
|
|
|
base->setDevice(qfile, false);
|
|
|
|
// we need to reopen the file to set the mode inside the filter stuff
|
|
|
|
// we need to reopen the file to set the mode inside the filter stuff
|
|
|
|
dev = new KFilterDev(base, true);
|
|
|
|
dev = new KFilterDev(base, true);
|
|
|
|
if(!dev || !dev->open(IO_WriteOnly)) {
|
|
|
|
if(!dev || !dev->open(IO_WriteOnly)) {
|
|
|
|