Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
hermit4 committed Nov 2, 2013
2 parents e377afa + e54b94e commit 4a72f7f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions favoritemenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QStandardPaths>
#include <QDebug>

#define FAVORITE_DOWNLOAD_FILE QStringLiteral("favoritedata.json")
#define FAVORITE_DOWNLOAD_FILE QString("%1/favoritedata.json").arg(QStandardPaths::writableLocation(QStandardPaths::DataLocation))
#define FAVORITE_DOWNLOAD_URL QUrl("http://relog.xii.jp/download/kancolle/data/favoritedata.json")
#define TO_VALUE(array_at, key) QJsonObject(array_at.toObject()).value(key)
#define TO_STRING(array_at, key) QJsonObject(array_at.toObject()).value(key).toString()
Expand Down Expand Up @@ -92,7 +93,6 @@ void FavoriteMenu::load(QMenu *menu, bool download)
}
settings.endGroup();


//お気に入りをダウンロード
if(download){
updateFromInternet();
Expand Down
2 changes: 1 addition & 1 deletion qml/KanmusuMemory/timerDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Rectangle {
function responseHttp(oj){
var data = JSON.parse(oj.responseText)
var i
var local_path = file.getApplicationPath() + "/timerselectguide.json"
var local_path = file.getWritablePath() + "/timerselectguide.json"
var local_data = ""

if(file.exists(local_path)){
Expand Down
6 changes: 6 additions & 0 deletions qtquick/qmlfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <QDir>
#include <QFileDialog>
#include <QApplication>
#include <QStandardPaths>

QMLFile::QMLFile(QObject *parent):
QObject(parent)
Expand Down Expand Up @@ -95,6 +96,11 @@ QString QMLFile::getApplicationPath()
return QApplication::applicationDirPath();
}

QString QMLFile::getWritablePath()
{
return QStandardPaths::writableLocation(QStandardPaths::DataLocation);
}


//ファイルコピー開始
bool QMLFile::copy(const QString &fileName, const QString &newName)
Expand Down
1 change: 1 addition & 0 deletions qtquick/qmlfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class QMLFile : public QObject
Q_INVOKABLE QString getExistingDirectory(const QString &title, const QString &default_path);
Q_INVOKABLE QString getOpenFileName(const QString &title, const QString &default_path, const QString &filter);
Q_INVOKABLE QString getApplicationPath();
Q_INVOKABLE QString getWritablePath();
Q_INVOKABLE bool copy(const QString &fileName, const QString &newName);
Q_INVOKABLE QString currentPath();
Q_INVOKABLE bool setCurrent(const QString &path);
Expand Down

0 comments on commit 4a72f7f

Please sign in to comment.