From eac0254744925fb1a1788bd2470b8a9829bc470f Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 11 Mar 2007 19:11:20 +0000 Subject: [PATCH] - Fixed a crash when save dir was an empty string, now defaulting to ~/qBT-dir/ --- src/options_imp.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/options_imp.cpp b/src/options_imp.cpp index 9dc5e2d47..3c7a30a26 100644 --- a/src/options_imp.cpp +++ b/src/options_imp.cpp @@ -504,6 +504,13 @@ float options_imp::getRatio() const{ // Return Save Path QString options_imp::getSavePath() const{ + QString home = QDir::homePath(); + if(home[home.length()-1] != QDir::separator()){ + home += QDir::separator(); + } + if(txt_savePath->text().trimmed().isEmpty()){ + txt_savePath->setText(home+"qBT_dir"); + } return txt_savePath->text(); }