Playlist tweak - minimizing impact of refresh on the UI.
[vlc-remote] / appsettings.cpp
1 /*   VLC-REMOTE for MAEMO 5
2 *   Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>, Yann Nave <yannux@onbebop.net>
3 *   This program is free software; you can redistribute it and/or modify
4 *   it under the terms of the GNU General Public License version 2,
5 *   or (at your option) any later version, as published by the Free
6 *   Software Foundation
7 *
8 *   This program is distributed in the hope that it will be useful,
9 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
10 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 *   GNU General Public License for more details
12 *
13 *   You should have received a copy of the GNU General Public
14 *   License along with this program; if not, write to the
15 *   Free Software Foundation, Inc.,
16 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 */
18 #include "appsettings.h"
19 // initialize static storage for settings reference
20 //QSettings AppSettings::settings;
21
22 AppSettings::AppSettings() {
23 }
24
25 AppSettings::~AppSettings() {
26     ;
27 }
28
29 QString AppSettings::getCurrentKey() {
30     QSettings sets;
31     return sets.value("config/currentKey", "").toString();
32 }
33 QString AppSettings::getCurrentIp() {
34     QSettings sets;
35     return sets.value("account/" + getCurrentKey(), "").toString();
36 }
37 VlcDirectory AppSettings::getHomeDirectory() {
38     QSettings sets;
39     VlcDirectory home;
40     home.name = sets.value("config/accounts/" + getCurrentKey() + "/homeDirName", "Default").toString();
41     home.path = sets.value("config/accounts/" + getCurrentKey() + "/homeDirPath", "~/").toString();
42     return home;
43 }
44 bool AppSettings::setHomeDirectory(VlcDirectory dir) {
45     QSettings sets;
46     sets.setValue("config/accounts/" + getCurrentKey() + "/homeDirName", dir.name);
47     sets.setValue("config/accounts/" + getCurrentKey() + "/homeDirPath", dir.path);
48     return true;
49 }
50 QList<VlcDirectory>* AppSettings::getFavourites() { return new QList<VlcDirectory>(); }
51 bool AppSettings::addFavourite(VlcDirectory dir) { return true; }
52 bool AppSettings::deleteFavourite(VlcDirectory dir) { return true; }
53 Orientation AppSettings::setOrientation(Orientation orientation) {
54     QSettings sets;
55     sets.setValue("config/orientation", (int)orientation);
56     return orientation;
57 }
58 Orientation AppSettings::getOrientation() {
59     QSettings sets;
60     return (Orientation)(sets.value("config/orientation", AUTO_ROTATE).toInt());
61 }
62