projects
/
pub
/
Android
/
ownCloud.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3515ab1
)
Increase db number and added getters and setter for new 'uploading' and 'downloading...
author
jabarros
<jabarros@solidgear.es>
Mon, 19 Jan 2015 13:41:34 +0000
(14:41 +0100)
committer
jabarros
<jabarros@solidgear.es>
Mon, 19 Jan 2015 13:41:34 +0000
(14:41 +0100)
src/com/owncloud/android/datamodel/FileDataStorageManager.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/datamodel/OCFile.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/db/ProviderMeta.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/files/services/FileDownloader.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/files/services/FileUploader.java
patch
|
blob
|
blame
|
history
diff --git
a/src/com/owncloud/android/datamodel/FileDataStorageManager.java
b/src/com/owncloud/android/datamodel/FileDataStorageManager.java
index
d803064
..
c1bf61b
100644
(file)
--- a/
src/com/owncloud/android/datamodel/FileDataStorageManager.java
+++ b/
src/com/owncloud/android/datamodel/FileDataStorageManager.java
@@
-193,6
+193,8
@@
public class FileDataStorageManager {
cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail());
cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail());
+ cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading());
+ cv.put(ProviderTableMeta.FILE_IS_UPLOADING, file.isUploading());
boolean sameRemotePath = fileExists(file.getRemotePath());
if (sameRemotePath ||
boolean sameRemotePath = fileExists(file.getRemotePath());
if (sameRemotePath ||
@@
-302,6
+304,8
@@
public class FileDataStorageManager {
cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail());
cv.put(ProviderTableMeta.FILE_PERMISSIONS, file.getPermissions());
cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId());
cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail());
+ cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading());
+ cv.put(ProviderTableMeta.FILE_IS_UPLOADING, file.isUploading());
boolean existsByPath = fileExists(file.getRemotePath());
if (existsByPath || fileExists(file.getFileId())) {
boolean existsByPath = fileExists(file.getRemotePath());
if (existsByPath || fileExists(file.getFileId())) {
@@
-877,6
+881,10
@@
public class FileDataStorageManager {
file.setRemoteId(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_REMOTE_ID)));
file.setNeedsUpdateThumbnail(c.getInt(
c.getColumnIndex(ProviderTableMeta.FILE_UPDATE_THUMBNAIL)) == 1 ? true : false);
file.setRemoteId(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_REMOTE_ID)));
file.setNeedsUpdateThumbnail(c.getInt(
c.getColumnIndex(ProviderTableMeta.FILE_UPDATE_THUMBNAIL)) == 1 ? true : false);
+ file.setDownloading(c.getInt(
+ c.getColumnIndex(ProviderTableMeta.FILE_IS_DOWNLOADING)) == 1 ? true : false);
+ file.setUploading(c.getInt(
+ c.getColumnIndex(ProviderTableMeta.FILE_IS_UPLOADING)) == 1 ? true : false);
}
return file;
}
return file;
@@
-1259,6
+1267,14
@@
public class FileDataStorageManager {
ProviderTableMeta.FILE_UPDATE_THUMBNAIL,
file.needsUpdateThumbnail() ? 1 : 0
);
ProviderTableMeta.FILE_UPDATE_THUMBNAIL,
file.needsUpdateThumbnail() ? 1 : 0
);
+ cv.put(
+ ProviderTableMeta.FILE_IS_DOWNLOADING,
+ file.isDownloading() ? 1 : 0
+ );
+ cv.put(
+ ProviderTableMeta.FILE_IS_UPLOADING,
+ file.isUploading() ? 1 : 0
+ );
boolean existsByPath = fileExists(file.getRemotePath());
if (existsByPath || fileExists(file.getFileId())) {
boolean existsByPath = fileExists(file.getRemotePath());
if (existsByPath || fileExists(file.getFileId())) {
diff --git
a/src/com/owncloud/android/datamodel/OCFile.java
b/src/com/owncloud/android/datamodel/OCFile.java
index
cf25d27
..
222746b
100644
(file)
--- a/
src/com/owncloud/android/datamodel/OCFile.java
+++ b/
src/com/owncloud/android/datamodel/OCFile.java
@@
-70,6
+70,9
@@
public class OCFile implements Parcelable, Comparable<OCFile> {
private boolean mNeedsUpdateThumbnail;
private boolean mNeedsUpdateThumbnail;
+ private boolean mIsDownloading;
+ private boolean mIsUploading;
+
/**
* Create new {@link OCFile} with given path.
/**
* Create new {@link OCFile} with given path.
@@
-112,6
+115,8
@@
public class OCFile implements Parcelable, Comparable<OCFile> {
mPermissions = source.readString();
mRemoteId = source.readString();
mNeedsUpdateThumbnail = source.readInt() == 0;
mPermissions = source.readString();
mRemoteId = source.readString();
mNeedsUpdateThumbnail = source.readInt() == 0;
+ mIsDownloading = source.readInt() == 0;
+ mIsUploading = source.readInt() == 0;
}
}
@@
-136,6
+141,8
@@
public class OCFile implements Parcelable, Comparable<OCFile> {
dest.writeString(mPermissions);
dest.writeString(mRemoteId);
dest.writeInt(mNeedsUpdateThumbnail ? 1 : 0);
dest.writeString(mPermissions);
dest.writeString(mRemoteId);
dest.writeInt(mNeedsUpdateThumbnail ? 1 : 0);
+ dest.writeInt(mIsDownloading ? 1 : 0);
+ dest.writeInt(mIsUploading ? 1 : 0);
}
/**
}
/**
@@
-348,6
+355,8
@@
public class OCFile implements Parcelable, Comparable<OCFile> {
mPermissions = null;
mRemoteId = null;
mNeedsUpdateThumbnail = false;
mPermissions = null;
mRemoteId = null;
mNeedsUpdateThumbnail = false;
+ mIsDownloading = false;
+ mIsUploading = false;
}
/**
}
/**
@@
-562,4
+571,20
@@
public class OCFile implements Parcelable, Comparable<OCFile> {
this.mRemoteId = remoteId;
}
this.mRemoteId = remoteId;
}
+ public boolean isDownloading() {
+ return mIsDownloading;
+ }
+
+ public boolean isUploading() {
+ return mIsUploading;
+ }
+
+ public void setUploading(boolean isUploading) {
+ this.mIsUploading = isUploading;
+ }
+
+ public void setDownloading(boolean isDownloading) {
+ this.mIsDownloading = isDownloading;
+ }
+
}
}
diff --git
a/src/com/owncloud/android/db/ProviderMeta.java
b/src/com/owncloud/android/db/ProviderMeta.java
index
2c74249
..
06770b6
100644
(file)
--- a/
src/com/owncloud/android/db/ProviderMeta.java
+++ b/
src/com/owncloud/android/db/ProviderMeta.java
@@
-31,7
+31,7
@@
import com.owncloud.android.MainApp;
public class ProviderMeta {
\r
\r
public static final String DB_NAME = "filelist";
\r
public class ProviderMeta {
\r
\r
public static final String DB_NAME = "filelist";
\r
- public static final int DB_VERSION =
8
;
\r
+ public static final int DB_VERSION =
9
;
\r
\r
private ProviderMeta() {
\r
}
\r
\r
private ProviderMeta() {
\r
}
\r
diff --git
a/src/com/owncloud/android/files/services/FileDownloader.java
b/src/com/owncloud/android/files/services/FileDownloader.java
index
eb870e1
..
7c8cad5
100644
(file)
--- a/
src/com/owncloud/android/files/services/FileDownloader.java
+++ b/
src/com/owncloud/android/files/services/FileDownloader.java
@@
-415,6
+415,8
@@
public class FileDownloader extends Service implements OnDatatransferProgressLis
file.setStoragePath(mCurrentDownload.getSavePath());
file.setFileLength((new File(mCurrentDownload.getSavePath()).length()));
file.setRemoteId(mCurrentDownload.getFile().getRemoteId());
file.setStoragePath(mCurrentDownload.getSavePath());
file.setFileLength((new File(mCurrentDownload.getSavePath()).length()));
file.setRemoteId(mCurrentDownload.getFile().getRemoteId());
+ file.setDownloading(false);
+ file.setUploading(false);
mStorageManager.saveFile(file);
mStorageManager.triggerMediaScan(file.getStoragePath());
}
mStorageManager.saveFile(file);
mStorageManager.triggerMediaScan(file.getStoragePath());
}
diff --git
a/src/com/owncloud/android/files/services/FileUploader.java
b/src/com/owncloud/android/files/services/FileUploader.java
index
0480440
..
d26fad5
100644
(file)
--- a/
src/com/owncloud/android/files/services/FileUploader.java
+++ b/
src/com/owncloud/android/files/services/FileUploader.java
@@
-635,6
+635,8
@@
public class FileUploader extends Service implements OnDatatransferProgressListe
// in the instance returned by mCurrentUpload.getFile()
}
file.setNeedsUpdateThumbnail(true);
// in the instance returned by mCurrentUpload.getFile()
}
file.setNeedsUpdateThumbnail(true);
+ file.setDownloading(false);
+ file.setUploading(false);
mStorageManager.saveFile(file);
}
mStorageManager.saveFile(file);
}