You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2013/12/03 01:06:40 UTC
[2/4] git commit: [ubuntu] change location of persistent dir
[ubuntu] change location of persistent dir
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/ab9de01d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/ab9de01d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/ab9de01d
Branch: refs/heads/dev
Commit: ab9de01de2765392dc397e9d7a5ce1c6a983ca56
Parents: af8d7c2
Author: Maxim Ermilov <ma...@canonical.com>
Authored: Mon Nov 11 18:21:36 2013 +0400
Committer: Maxim Ermilov <ma...@canonical.com>
Committed: Mon Nov 11 18:21:36 2013 +0400
----------------------------------------------------------------------
src/ubuntu/file.cpp | 11 ++++-------
src/ubuntu/file.h | 1 -
www/ubuntu/FileWriter.js | 4 ----
3 files changed, 4 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/ab9de01d/src/ubuntu/file.cpp
----------------------------------------------------------------------
diff --git a/src/ubuntu/file.cpp b/src/ubuntu/file.cpp
index cb85067..4c751e2 100644
--- a/src/ubuntu/file.cpp
+++ b/src/ubuntu/file.cpp
@@ -63,8 +63,8 @@ const QString FileError::kPathExistsErr("FileError.PATH_EXISTS_ERR");
File::File(Cordova *cordova) :
CPlugin(cordova),
- _persistentDir(QDir::homePath() + "/.local/share/cordova-ubuntu/persistent/" + QString(cordova->get_app_dir().toUtf8().toBase64())),
- lastRequestId(1) {
+ _persistentDir(QString("%1/.local/share/%2/persistent").arg(QDir::homePath()).arg(QCoreApplication::applicationName())) {
+ QDir::root().mkpath(QDir(_persistentDir).absolutePath());
}
void File::requestFileSystem(int scId, int ecId, unsigned short type, unsigned long long size) {
@@ -76,13 +76,10 @@ void File::requestFileSystem(int scId, int ecId, unsigned short type, unsigned l
return;
}
- if (type == 0) {
+ if (type == 0)
dir = QDir::temp();
- }
- else {
+ else
dir = QDir(_persistentDir);
- QDir::root().mkpath(dir.absolutePath());
- }
if (type > 1) {
this->callback(ecId, FileError::kSyntaxErr);
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/ab9de01d/src/ubuntu/file.h
----------------------------------------------------------------------
diff --git a/src/ubuntu/file.h b/src/ubuntu/file.h
index f518ab3..0037ad2 100644
--- a/src/ubuntu/file.h
+++ b/src/ubuntu/file.h
@@ -68,7 +68,6 @@ private:
QMimeDatabase _db;
const QString _persistentDir;
QNetworkAccessManager _manager;
- int lastRequestId;
};
#endif
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/ab9de01d/www/ubuntu/FileWriter.js
----------------------------------------------------------------------
diff --git a/www/ubuntu/FileWriter.js b/www/ubuntu/FileWriter.js
index 454366d..85cad8a 100644
--- a/www/ubuntu/FileWriter.js
+++ b/www/ubuntu/FileWriter.js
@@ -24,10 +24,6 @@ var exec = require('cordova/exec'),
ProgressEvent = require('./ProgressEvent');
function write(data) {
-console.log(19);
-console.log(91);
-console.log(19);
-
var that=this;
var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined');
var isBinary;