merged sniperbeamer's patches
fixed bug #1828965 git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@149 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
|
||||
QFile* ExporterBase::openFile(QWidget* parent, QString id, QStringList Filters){
|
||||
QString filename=KpxFileDialogs::saveFile(parent,id,tr("Import File..."),Filters);
|
||||
if(filename==QString())return NULL;
|
||||
if(filename.isEmpty())return NULL;
|
||||
QFile* file=new QFile(filename);
|
||||
if(!file->open(QIODevice::ReadWrite|QIODevice::Truncate)){
|
||||
QMessageBox::critical(parent,tr("Export Failed"),decodeFileError(file->error()));
|
||||
|
||||
@@ -34,6 +34,8 @@ class IExport{
|
||||
};
|
||||
|
||||
class ExporterBase:public QObject{
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
virtual QFile* openFile(QWidget* GuiParent,QString id,QStringList Filter);
|
||||
};
|
||||
|
||||
@@ -21,14 +21,16 @@
|
||||
#ifndef _EXPORT_KPX_XML_H_
|
||||
#define _EXPORT_KPX_XML_H_
|
||||
|
||||
#include <QObject>
|
||||
#include <QDomElement>
|
||||
#include "Export.h"
|
||||
|
||||
class Export_KeePassX_Xml:public IExport, public ExporterBase{
|
||||
class Export_KeePassX_Xml:public ExporterBase, public IExport{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
virtual bool exportDatabase(QWidget* GuiParent, IDatabase* Database);
|
||||
virtual QString identifier(){return "EXPORT_KEEPASSX_XML";}
|
||||
virtual QString title(){return "KeePassX XML File";}
|
||||
virtual QString title(){return tr("KeePassX XML File");}
|
||||
private:
|
||||
void addGroup(IGroupHandle* group,QDomElement& parent,QDomDocument& doc);
|
||||
void addEntry(IEntryHandle* group,QDomElement& parent,QDomDocument& doc);
|
||||
|
||||
@@ -23,11 +23,13 @@
|
||||
#include <QObject>
|
||||
#include "Export.h"
|
||||
|
||||
class Export_Txt:public IExport, public ExporterBase{
|
||||
class Export_Txt:public ExporterBase, public IExport{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
virtual bool exportDatabase(QWidget* GuiParent, IDatabase* Database);
|
||||
virtual QString identifier(){return "e_txt";}
|
||||
virtual QString title(){return "Text File";}
|
||||
virtual QString title(){return tr("Text File");}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user