From 1003ecb7be1961f6911827c302149b270ba0f49e Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Mon, 15 Apr 2013 13:32:49 +0200 Subject: [PATCH] Moved log path definition to FileStorageUtils --- src/com/owncloud/android/ui/activity/LogHistoryActivity.java | 4 ++-- src/com/owncloud/android/ui/activity/Preferences.java | 1 - src/com/owncloud/android/utils/FileStorageUtils.java | 4 ++++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/owncloud/android/ui/activity/LogHistoryActivity.java b/src/com/owncloud/android/ui/activity/LogHistoryActivity.java index dd068c7557..64dcf0b442 100644 --- a/src/com/owncloud/android/ui/activity/LogHistoryActivity.java +++ b/src/com/owncloud/android/ui/activity/LogHistoryActivity.java @@ -23,7 +23,6 @@ import java.util.ArrayList; import android.content.Intent; import android.os.Bundle; -import android.os.Environment; import android.preference.Preference; import android.preference.Preference.OnPreferenceChangeListener; import android.view.View; @@ -36,11 +35,12 @@ import com.actionbarsherlock.app.SherlockPreferenceActivity; import com.actionbarsherlock.view.MenuItem; import com.owncloud.android.R; import com.owncloud.android.ui.adapter.LogListAdapter; +import com.owncloud.android.utils.FileStorageUtils; public class LogHistoryActivity extends SherlockPreferenceActivity implements OnPreferenceChangeListener { - String logpath = Environment.getExternalStorageDirectory()+File.separator+"owncloud"+File.separator+"log"; + String logpath = FileStorageUtils.getLogPath(); File logDIR = null; @Override diff --git a/src/com/owncloud/android/ui/activity/Preferences.java b/src/com/owncloud/android/ui/activity/Preferences.java index 1f9632c3a2..b206708a59 100644 --- a/src/com/owncloud/android/ui/activity/Preferences.java +++ b/src/com/owncloud/android/ui/activity/Preferences.java @@ -33,7 +33,6 @@ import android.preference.Preference; import android.preference.Preference.OnPreferenceChangeListener; import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceManager; -import android.util.Log; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.app.SherlockPreferenceActivity; diff --git a/src/com/owncloud/android/utils/FileStorageUtils.java b/src/com/owncloud/android/utils/FileStorageUtils.java index 72815a9a9e..144ff80d16 100644 --- a/src/com/owncloud/android/utils/FileStorageUtils.java +++ b/src/com/owncloud/android/utils/FileStorageUtils.java @@ -65,6 +65,10 @@ public class FileStorageUtils { } } + + public static final String getLogPath() { + return Environment.getExternalStorageDirectory() + File.separator + "owncloud" + File.separator + "log"; + } // to ensure we will not add the slash twice between filename and // folder-name