Mercurial > hg > octave-nkf
changeset 14845:9a355dfc7701 gui
Fixed bug with GUI not starting the first time.
* resource-manager.cc: Now creating config directory before attempting to copy a file to it.
author | Jacob Dawid <jacob.dawid@gmail.com> |
---|---|
date | Sat, 07 Jul 2012 14:28:21 +0200 |
parents | 422b0b2ce5f8 |
children | 3ff18e21c742 |
files | gui/src/resource-manager.cc |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/src/resource-manager.cc +++ b/gui/src/resource-manager.cc @@ -17,6 +17,8 @@ #include "resource-manager.h" #include <QFile> +#include <QDir> + #include <QNetworkProxy> resource_manager resource_manager::_singleton; @@ -50,10 +52,12 @@ { QDesktopServices desktopServices; _home_path = desktopServices.storageLocation (QDesktopServices::HomeLocation); - QString settings_file = _home_path + "/.config/octave-gui/settings"; + QString settings_path = _home_path + "/.config/octave-gui/"; + QString settings_file = settings_path + "settings"; if (!QFile::exists (settings_file)) { + QDir("/").mkpath (settings_path); QFile::copy ("../default-settings", settings_file); _first_run = true; }