[BeFree CVS] neptune/libneptune-gui bfileview.cpp,1.21,1.22
Status: Planning
Brought to you by:
plfiorini
|
From: Pier L. F. <plf...@us...> - 2005-01-03 16:40:08
|
Update of /cvsroot/befree/neptune/libneptune-gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25086 Modified Files: bfileview.cpp Log Message: Check if index is valid in BFileView::doubleClicked() Index: bfileview.cpp =================================================================== RCS file: /cvsroot/befree/neptune/libneptune-gui/bfileview.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- bfileview.cpp 3 Jan 2005 11:56:12 -0000 1.21 +++ bfileview.cpp 3 Jan 2005 16:39:57 -0000 1.22 @@ -356,6 +356,10 @@ */ void BFileView::doubleClicked(const QModelIndex &index) { + // Cannot open item if index isn't valid + if (!index.isValid()) + return; + // Open a folder if (fModel->isDir(index)) { @@ -363,7 +367,7 @@ setRoot(index); // Set new location - fLocation = fModel->fileInfo(index).absolutePath(); + fLocation = fModel->path(index); emit locationChanged(fLocation); } |