Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions liteidex/src/liteapp/multifolderwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ MultiFolderWindow::MultiFolderWindow(LiteApi::IApplication *app, QObject *parent
connect(m_folderListView,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(doubleClickedFolderView(QModelIndex)));
connect(m_folderListView,SIGNAL(enterKeyPressed(QModelIndex)),this,SLOT(enterKeyPressedFolderView(QModelIndex)));
connect(m_liteApp->editorManager(),SIGNAL(currentEditorChanged(LiteApi::IEditor*)),this,SLOT(currentEditorChanged(LiteApi::IEditor*)));
connect(m_liteApp->editorManager(),SIGNAL(editorAboutToClose(LiteApi::IEditor*)),this,SLOT(editorAboutToClose(LiteApi::IEditor*)));
}

MultiFolderWindow::~MultiFolderWindow()
Expand Down Expand Up @@ -169,28 +168,6 @@ void MultiFolderWindow::currentEditorChanged(LiteApi::IEditor *editor)
m_folderListView->setCurrentIndex(index);
}

void MultiFolderWindow::editorAboutToClose(LiteApi::IEditor *editor)
{
if (!m_bSyncEditor || !editor || editor->filePath().isEmpty()) {
return;
}

QString folderPath = QFileInfo(editor->filePath()).absolutePath();
foreach (LiteApi::IEditor *openEditor, m_liteApp->editorManager()->editorList()) {
if (openEditor != editor && !openEditor->filePath().isEmpty()
&& QFileInfo(openEditor->filePath()).absolutePath() == folderPath) {
return;
}
}

QList<QModelIndex> indexes = m_folderListView->indexForPath(folderPath);
foreach (const QModelIndex &index, indexes) {
if (index.isValid()) {
m_folderListView->setExpanded(index, false);
}
}
}

void MultiFolderWindow::aboutToShowFolderContextMenu(QMenu *menu, LiteApi::FILESYSTEM_CONTEXT_FLAG flag, const QFileInfo &info)
{
m_liteApp->fileManager()->emitAboutToShowFolderContextMenu(menu,flag,info,"liteapp/folder");
Expand Down
1 change: 0 additions & 1 deletion liteidex/src/liteapp/multifolderwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public slots:
void doubleClickedFolderView(const QModelIndex &index);
void enterKeyPressedFolderView(const QModelIndex &index);
void currentEditorChanged(LiteApi::IEditor *editor);
void editorAboutToClose(LiteApi::IEditor *editor);
void aboutToShowFolderContextMenu(QMenu *menu, LiteApi::FILESYSTEM_CONTEXT_FLAG flag, const QFileInfo &info);
protected:
LiteApi::IApplication *m_liteApp;
Expand Down
24 changes: 0 additions & 24 deletions liteidex/src/liteapp/splitfolderwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ SplitFolderWindow::SplitFolderWindow(IApplication *app, QObject *parent)
connect(m_tree,SIGNAL(reloadFolderIndex(QModelIndex)),this,SLOT(reloadFolderIndex(QModelIndex)));

connect(m_liteApp->editorManager(),SIGNAL(currentEditorChanged(LiteApi::IEditor*)),this,SLOT(currentEditorChanged(LiteApi::IEditor*)));
connect(m_liteApp->editorManager(),SIGNAL(editorAboutToClose(LiteApi::IEditor*)),this,SLOT(editorAboutToClose(LiteApi::IEditor*)));

QByteArray state = m_liteApp->settings()->value("LiteApp/BoxFolderSplitter").toByteArray();
m_spliter->restoreState(state);
Expand Down Expand Up @@ -244,29 +243,6 @@ void SplitFolderWindow::currentEditorChanged(IEditor *editor)
}
}

void SplitFolderWindow::editorAboutToClose(IEditor *editor)
{
if (!m_bSyncEditor || !editor || editor->filePath().isEmpty()) {
return;
}

QString folderPath = QFileInfo(editor->filePath()).absolutePath();
foreach (IEditor *openEditor, m_liteApp->editorManager()->editorList()) {
if (openEditor != editor && !openEditor->filePath().isEmpty()
&& QFileInfo(openEditor->filePath()).absolutePath() == folderPath) {
return;
}
}

for (int i = 0; i < m_stacked->count(); ++i) {
FolderView *view = (FolderView*)m_stacked->widget(i);
QModelIndex index = view->indexForPath(QDir::toNativeSeparators(folderPath));
if (index.isValid()) {
view->setExpanded(index, false);
}
}
}

void SplitFolderWindow::doubleClickedFolderView(const QModelIndex &index)
{
if (!index.isValid()) {
Expand Down
1 change: 0 additions & 1 deletion liteidex/src/liteapp/splitfolderwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public slots:
void closeFolderIndex(const QModelIndex &index);
void reloadFolderIndex(const QModelIndex &index);
void currentEditorChanged(LiteApi::IEditor *editor);
void editorAboutToClose(LiteApi::IEditor *editor);
void doubleClickedFolderView(const QModelIndex &index);
void enterKeyPressedFolderView(const QModelIndex &index);
void aboutToShowFolderContextMenu(QMenu *menu, LiteApi::FILESYSTEM_CONTEXT_FLAG flag, const QFileInfo &info);
Expand Down
Loading