Skip to content

Commit

Permalink
Repositioned saved filetree on linux and OSX. Needs verification
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertKrajewski committed Jan 30, 2015
1 parent 4381c78 commit 77e31d2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
// Hauptadresse des Sharepointdienstes
QString MainURL = "https://www3.elearning.rwth-aachen.de";

#ifdef Q_OS_WIN32
QString dataPath = "data.xml";
#elif Q_OS_LINUX
QString dataPath = "$HOME/.config/Sync-my-L2P/";
#else
QString dataPath = "data.xml";
#endif


Browser::Browser(QWidget *parent) :
QWidget(parent),
ui(new Ui::Browser)
Expand Down Expand Up @@ -96,7 +105,7 @@ void Browser::loadSettings()

QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf-8"));

QFile file("data.xml");
QFile file(dataPath);
if(!file.open(QIODevice::ReadWrite))
{
QLOG_ERROR() << "Kann keine Daten von Festplatte laden.";
Expand Down Expand Up @@ -147,7 +156,7 @@ void Browser::saveSettings()
QDomDocument domDoc;
saveStructureelementToXml(domDoc, itemModel->invisibleRootItem(), NULL);

QFile file("data.xml");
QFile file(dataPath);
if(!file.open(QIODevice::WriteOnly))
{
return;
Expand Down

0 comments on commit 77e31d2

Please sign in to comment.