Skip to content

Commit 61be7d0

Browse files
committed
fix folderview
1 parent 6a6afea commit 61be7d0

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

liteidex/src/liteapp/filemanager.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,11 @@ void FileManager::showHideFiles(bool b)
558558
}
559559
m_folderListView->model()->setFilter(filters);
560560
}
561-
562561
void FileManager::doubleClickedFolderView(const QModelIndex &index)
563562
{
563+
if (!index.isValid()) {
564+
return;
565+
}
564566
QFileInfo info = m_folderListView->model()->fileInfo(index);
565567
if (info.isFile()) {
566568
this->openEditor(info.filePath());

liteidex/src/liteapp/filemanager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ using namespace LiteApi;
3232
class QFileSystemWatcher;
3333
class NewFileDialog;
3434
class FolderListView;
35+
3536
class FileManager : public IFileManager
3637
{
3738
Q_OBJECT

liteidex/src/utils/folderview/folderlistmodel.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -576,13 +576,6 @@ bool FolderListModel::setHeaderData(int section, Qt::Orientation orientation, co
576576
}
577577
}
578578

579-
580-
QModelIndex FolderListModel::buddy(const QModelIndex &index) const
581-
{
582-
QModelIndex sourceIndex = mapToSource(index);
583-
return mapFromSource(sourceIndex.model()->buddy(sourceIndex));
584-
}
585-
586579
bool FolderListModel::insertColumns(int column, int count, const QModelIndex& parent)
587580
{
588581
Q_ASSERT(parent.isValid() ? parent.model() == this : true);
@@ -674,6 +667,11 @@ bool FolderListModel::hasChildren(const QModelIndex &parent) const
674667
return sourceIndex.model()->hasChildren(sourceIndex);
675668
}
676669

670+
QModelIndex FolderListModel::buddy(const QModelIndex &index) const
671+
{
672+
return index;
673+
}
674+
677675
void FolderListModel::sourceColumnsAboutToBeInserted(const QModelIndex &parent, int start, int end)
678676
{
679677
//Q_ASSERT(parent.isValid() ? parent.model() == m_model : true);

liteidex/src/utils/folderview/folderlistmodel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <QFileSystemModel>
2929
#include <QModelIndex>
3030
#include <QItemSelection>
31+
#include <QIdentityProxyModel>
3132

3233
class QFileSystemWatcher;
3334

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
LIBS *= -l$$qtLibraryName(foldersview)
1+
LIBS *= -l$$qtLibraryName(folderview)
22

33

44

liteidex/src/utils/folderview/folderview.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
TARGET = foldersview
1+
TARGET = folderview
22
TEMPLATE = lib
33
CONFIG += staticlib
44

0 commit comments

Comments
 (0)