Use DocumentsLocation as default dir

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@348 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
sniperbeamer 2009-10-08 19:27:39 +00:00
parent 338aa5f332
commit e0d26d94d7
1 changed files with 9 additions and 1 deletions

View File

@ -18,6 +18,9 @@
***************************************************************************/ ***************************************************************************/
#include <QFileDialog> #include <QFileDialog>
#if QT_VERSION >= 0x040400
#include <QDesktopServices>
#endif
IFileDialog* KpxFileDialogs::iFileDialog=NULL; IFileDialog* KpxFileDialogs::iFileDialog=NULL;
QtStandardFileDialogs DefaultQtDlgs; QtStandardFileDialogs DefaultQtDlgs;
@ -146,8 +149,13 @@ int QtStandardFileDialogs::getLastFilter(){
QString FileDlgHistory::getDir(const QString& name){ QString FileDlgHistory::getDir(const QString& name){
Entry e=History.value(name); Entry e=History.value(name);
if(e.isNull()) if(e.isNull()) {
#if QT_VERSION >= 0x040400
return QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
#else
return QDir::homePath(); return QDir::homePath();
#endif
}
else else
return e.Dir; return e.Dir;
} }