--- as_slot.cpp 2003/01/24 16:32:18 1.85
+++ as_slot.cpp 2003/01/24 18:22:03 1.86
@@ -283,7 +283,13 @@
void Titraqform::openDoc(void)
{
int nResult = 0; // Holds return value from save first messagebox
- QString Filestring = QFileDialog::getOpenFileName(m_pPrefs->getString(TITRAQ_PREFASFILE, TITRAQ_DEFASFILE), trUtf8("Accounting Data (*.as);;Text files (*.txt);;All Files (*)"), this, trUtf8("ChooserDialog"), trUtf8("Choose a file to open"), NULL, false);
+
+ // Make sure we correctly get the name of the default file to open
+ QString Openas = m_pPrefs->getString(TITRAQ_PREFASFILE, TITRAQ_DEFASFILE);
+ if (Openas.startsWith(TITRAQ_HOMEDIRTOK))
+ Openas = QDir::homeDirPath() + Openas.remove(0, QString(TITRAQ_HOMEDIRTOK).length() - 1);
+
+ QString Filestring = QFileDialog::getOpenFileName(Openas, trUtf8("Accounting Data (*.as);;Text files (*.txt);;All Files (*)"), this, trUtf8("ChooserDialog"), trUtf8("Choose a file to open"), NULL, false);
if (!Filestring.isEmpty()) {
QFile Filetemp(Filestring); // File to load
@@ -373,8 +379,13 @@
{
int nResult = 0; // For checking user's answer
- // First get the selected file name to save to
- QString Filestring = QFileDialog::getSaveFileName(m_pPrefs->getString(TITRAQ_PREFASFILE, TITRAQ_DEFASFILE), trUtf8("Accounting Data (*.as);;Text files (*.txt);;All Files (*)"), this, trUtf8("ChooserDialog"), trUtf8("Choose a file to save"), NULL, false);
+ // Make sure we correctly get the name of the default file to open
+ QString Openas = m_pPrefs->getString(TITRAQ_PREFASFILE, TITRAQ_DEFASFILE);
+ if (Openas.startsWith(TITRAQ_HOMEDIRTOK))
+ Openas = QDir::homeDirPath() + Openas.remove(0, QString(TITRAQ_HOMEDIRTOK).length() - 1);
+
+ // And then get the name of the selected file to save to
+ QString Filestring = QFileDialog::getSaveFileName(Openas, trUtf8("Accounting Data (*.as);;Text files (*.txt);;All Files (*)"), this, trUtf8("ChooserDialog"), trUtf8("Choose a file to save"), NULL, false);
if (!Filestring.isEmpty()) {
if (QFile::exists(Filestring)) {
nResult = QMessageBox::warning(this, trUtf8(TITRAQ_APPTITLE),
|