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 | DolphinViewContainer* oldViewContainer = m_activeViewContainer; | 975 | DolphinViewContainer* oldViewContainer = m_activeViewContainer; | ||
976 | Q_ASSERT(viewContainer); | 976 | Q_ASSERT(viewContainer); | ||
977 | 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. | |||||
978 | m_activeViewContainer = viewContainer; | 978 | m_activeViewContainer = viewContainer; | ||
979 | 979 | | |||
980 | if (oldViewContainer) { | 980 | if (oldViewContainer) { | ||
981 | // Disconnect all signals between the old view container (container, | 981 | // Disconnect all signals between the old view container (container, | ||
982 | // view and url navigator) and main window. | 982 | // view and url navigator) and main window. | ||
983 | oldViewContainer->disconnect(this); | 983 | oldViewContainer->disconnect(this); | ||
984 | oldViewContainer->view()->disconnect(this); | 984 | oldViewContainer->view()->disconnect(this); | ||
985 | oldViewContainer->urlNavigator()->disconnect(this); | 985 | oldViewContainer->urlNavigator()->disconnect(this); | ||
Show All 17 Lines | |||||
1003 | { | 1003 | { | ||
1004 | const bool enableTabActions = (count > 1); | 1004 | const bool enableTabActions = (count > 1); | ||
1005 | actionCollection()->action(QStringLiteral("activate_next_tab"))->setEnabled(enableTabActions); | 1005 | actionCollection()->action(QStringLiteral("activate_next_tab"))->setEnabled(enableTabActions); | ||
1006 | actionCollection()->action(QStringLiteral("activate_prev_tab"))->setEnabled(enableTabActions); | 1006 | actionCollection()->action(QStringLiteral("activate_prev_tab"))->setEnabled(enableTabActions); | ||
1007 | } | 1007 | } | ||
1008 | 1008 | | |||
1009 | void DolphinMainWindow::updateWindowTitle() | 1009 | void DolphinMainWindow::updateWindowTitle() | ||
1010 | { | 1010 | { | ||
1011 | setWindowTitle(m_activeViewContainer->caption()); | 1011 | const QString newTitle = m_activeViewContainer->caption(); | ||
1012 | if (windowTitle() != newTitle) { | ||||
1013 | setWindowTitle(newTitle); | ||||
1014 | } | ||||
broulik: `const` | |||||
1012 | } | 1015 | } | ||
1013 | 1016 | | |||
1014 | void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mountPath) | 1017 | void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mountPath) | ||
1015 | { | 1018 | { | ||
1016 | if (m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) { | 1019 | if (m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) { | ||
1017 | m_tearDownFromPlacesRequested = true; | 1020 | m_tearDownFromPlacesRequested = true; | ||
1018 | m_terminalPanel->goHome(); | 1021 | m_terminalPanel->goHome(); | ||
1019 | // m_placesPanel->proceedWithTearDown() will be called in slotTerminalDirectoryChanged | 1022 | // 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.