Changeset View
Standalone View
src/dolphinmainwindow.cpp
Show First 20 Lines • Show All 966 Lines • ▼ Show 20 Line(s) | |||||
967 | 967 | | |||
968 | void DolphinMainWindow::closedTabsCountChanged(unsigned int count) | 968 | void DolphinMainWindow::closedTabsCountChanged(unsigned int count) | ||
969 | { | 969 | { | ||
970 | actionCollection()->action(QStringLiteral("undo_close_tab"))->setEnabled(count > 0); | 970 | actionCollection()->action(QStringLiteral("undo_close_tab"))->setEnabled(count > 0); | ||
971 | } | 971 | } | ||
972 | 972 | | |||
973 | void DolphinMainWindow::activeViewChanged(DolphinViewContainer* viewContainer) | 973 | void DolphinMainWindow::activeViewChanged(DolphinViewContainer* viewContainer) | ||
974 | { | 974 | { | ||
975 | if (m_activeViewContainer == viewContainer) { | ||||
976 | return; | ||||
977 | } | ||||
elvisangelaccio: This is a symptom that something else is wrong, but ok. | |||||
This seams to be called twice when dolphin is just starting up and twice when you change tabs. To Test I Used this code here. if (m_activeViewContainer == viewContainer) { static int calls = 1; qDebug() <<"ViewContainer Matches(" + QString::number(calls) + ") " << sender(); calls ++; return; } I also added this code to DolphinTabWidget::currentTabChanged() at line 330) if(viewContainer->isActive()) { static int calls = 1; qDebug() <<"View Active(" + QString::number(calls) + ") " << sender(); calls ++; return; } Example output
Create a new Tab:
Create a new Tab:
Switch to tab 1 (middle tab):
Switch to tab 2 (right most):
Switch to tab 0 (left most):
Every time you switch to the left most tab it has three of them . Without the code in the TabWidget it got one ViewContainer Match for every tab crated and every tab i switched to. rizzitello: This seams to be called twice when dolphin is just starting up and twice when you change tabs. | |||||
975 | DolphinViewContainer* oldViewContainer = m_activeViewContainer; | 978 | DolphinViewContainer* oldViewContainer = m_activeViewContainer; | ||
976 | Q_ASSERT(viewContainer); | 979 | Q_ASSERT(viewContainer); | ||
977 | 980 | | |||
978 | m_activeViewContainer = viewContainer; | 981 | m_activeViewContainer = viewContainer; | ||
979 | 982 | | |||
980 | if (oldViewContainer) { | 983 | if (oldViewContainer) { | ||
981 | // Disconnect all signals between the old view container (container, | 984 | // Disconnect all signals between the old view container (container, | ||
982 | // view and url navigator) and main window. | 985 | // view and url navigator) and main window. | ||
Show All 20 Lines | |||||
1003 | { | 1006 | { | ||
1004 | const bool enableTabActions = (count > 1); | 1007 | const bool enableTabActions = (count > 1); | ||
1005 | actionCollection()->action(QStringLiteral("activate_next_tab"))->setEnabled(enableTabActions); | 1008 | actionCollection()->action(QStringLiteral("activate_next_tab"))->setEnabled(enableTabActions); | ||
1006 | actionCollection()->action(QStringLiteral("activate_prev_tab"))->setEnabled(enableTabActions); | 1009 | actionCollection()->action(QStringLiteral("activate_prev_tab"))->setEnabled(enableTabActions); | ||
1007 | } | 1010 | } | ||
1008 | 1011 | | |||
1009 | void DolphinMainWindow::updateWindowTitle() | 1012 | void DolphinMainWindow::updateWindowTitle() | ||
1010 | { | 1013 | { | ||
1011 | setWindowTitle(m_activeViewContainer->caption()); | 1014 | const QString newTitle = m_activeViewContainer->caption(); | ||
1015 | if (windowTitle() != newTitle) { | ||||
1016 | setWindowTitle(newTitle); | ||||
1017 | } | ||||
broulik: `const` | |||||
1012 | } | 1018 | } | ||
1013 | 1019 | | |||
1014 | void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mountPath) | 1020 | void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mountPath) | ||
1015 | { | 1021 | { | ||
1016 | if (m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) { | 1022 | if (m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) { | ||
1017 | m_tearDownFromPlacesRequested = true; | 1023 | m_tearDownFromPlacesRequested = true; | ||
1018 | m_terminalPanel->goHome(); | 1024 | m_terminalPanel->goHome(); | ||
1019 | // m_placesPanel->proceedWithTearDown() will be called in slotTerminalDirectoryChanged | 1025 | // m_placesPanel->proceedWithTearDown() will be called in slotTerminalDirectoryChanged | ||
▲ Show 20 Lines • Show All 598 Lines • Show Last 20 Lines |
This is a symptom that something else is wrong, but ok.