aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-09-09 07:02:39 -0400
committerKen Moore <moorekou@gmail.com>2015-09-09 07:02:39 -0400
commit85c7880b5df7a6fc7b5dd89a2822fa14e003992b (patch)
tree69d0e1aa9dfeed69960a0503d802f1bef9d802d6
parentMerge pull request #153 from harcobbit/issue/11073 (diff)
parentSolves issue 11232 (diff)
downloadlumina-85c7880b5df7a6fc7b5dd89a2822fa14e003992b.tar.gz
lumina-85c7880b5df7a6fc7b5dd89a2822fa14e003992b.tar.bz2
lumina-85c7880b5df7a6fc7b5dd89a2822fa14e003992b.zip
Merge pull request #152 from harcobbit/issue/11232
Solves issue 11232
-rw-r--r--lumina-fm/widgets/DirWidget.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lumina-fm/widgets/DirWidget.cpp b/lumina-fm/widgets/DirWidget.cpp
index 0e0c404b..f2d7a5a6 100644
--- a/lumina-fm/widgets/DirWidget.cpp
+++ b/lumina-fm/widgets/DirWidget.cpp
@@ -166,7 +166,7 @@ void DirWidget::LoadDir(QString dir, QList<LFileInfo> list){
QString lastdir = CDIR; //for some checks later
QString lastbasedir = normalbasedir;
CDIR = dir;
- if(CDIR.endsWith("/")){ CDIR.chop(1); }
+ if(CDIR.endsWith("/") && CDIR.length() != 1){ CDIR.chop(1); }
CLIST = list; //save for laterr
canmodify = QFileInfo(CDIR).isWritable();
if(DEBUG){ qDebug() << "Clear UI:" <<time.elapsed(); }
@@ -723,6 +723,8 @@ void DirWidget::on_actionBack_triggered(){
void DirWidget::on_actionUp_triggered(){
QString dir = CDIR.section("/",0,-2);
+ if(dir.isEmpty())
+ dir = "/";
//Quick check to ensure the directory exists
while(!QFile::exists(dir) && !dir.isEmpty()){
dir = dir.section("/",0,-2); //back up one additional dir
@@ -858,4 +860,4 @@ void DirWidget::mouseReleaseEvent(QMouseEvent *ev){
}else{
ev->ignore(); //not handled here
}
-} \ No newline at end of file
+}
bgstack15