# HG changeset patch # User Santeri Piippo # Date 1377350268 -10800 # Node ID 5e96648f416f6db3e8f89b4ffbff49729b1690bb # Parent 1db661456fb4c73f5ab96f1bddc2112d780954f9 redirect the user to configuration if the download path is not given diff -r 1db661456fb4 -r 5e96648f416f src/configDialog.cpp --- a/src/configDialog.cpp Sat Aug 24 15:01:31 2013 +0300 +++ b/src/configDialog.cpp Sat Aug 24 16:17:48 2013 +0300 @@ -292,10 +292,6 @@ ld_defaultname = ui->m_profileName->text(); ld_defaultlicense = ui->m_profileLicense->currentIndex(); - // Ensure '/' postfix to the download path - if (net_downloadpath.value.right (1) != DIRSLASH) - net_downloadpath += DIRSLASH; - // Rebuild the quick color toolbar g_win->setQuickColors (quickColors); gui_colortoolbar = quickColorString(); diff -r 1db661456fb4 -r 5e96648f416f src/download.cpp --- a/src/download.cpp Sat Aug 24 15:01:31 2013 +0300 +++ b/src/download.cpp Sat Aug 24 16:17:48 2013 +0300 @@ -28,6 +28,7 @@ #include "gui.h" #include "file.h" #include "gldraw.h" +#include "configDialog.h" cfg (String, net_downloadpath, ""); cfg (Bool, net_guesspaths, true); @@ -43,6 +44,8 @@ if (path == "" || QDir (path).exists() == false) { critical (PartDownloader::tr ("You need to specify a valid path for " "downloaded files in the configuration to download paths.")); + + (new ConfigDialog (ConfigDialog::DownloadTab, null))->exec(); return; } @@ -196,7 +199,7 @@ modifyDest (dest); - if (QFile::exists (PartDownloader::getDownloadPath() + dest)) { + if (QFile::exists (PartDownloader::getDownloadPath() + DIRSLASH + dest)) { const str overwritemsg = fmt (tr ("%1 already exists in download directory. Overwrite?"), dest); if (!confirm (tr ("Overwrite?"), overwritemsg)) @@ -224,7 +227,7 @@ return; modifyDest (dest); - print ("DOWNLOAD: %1 -> %2\n", url, PartDownloader::getDownloadPath() + dest); + print ("DOWNLOAD: %1 -> %2\n", url, PartDownloader::getDownloadPath() + DIRSLASH + dest); PartDownloadRequest* req = new PartDownloadRequest (url, dest, primary, this); m_filesToDownload << dest; @@ -298,7 +301,7 @@ m_prompt (parent), m_url (url), m_dest (dest), - m_fpath (PartDownloader::getDownloadPath() + dest), + m_fpath (PartDownloader::getDownloadPath() + DIRSLASH + dest), m_nam (new QNetworkAccessManager), m_firstUpdate (true), m_state (Requesting),