-DQT_NO_CAST_FROM_ASCII
-DQT_NO_CAST_TO_ASCII
-DQT_NO_FOREACH
+ -DQT_NO_KEYWORDS
)
##########################################
updateViewActions();
updateGoActions();
- emit urlChanged(url);
+ Q_EMIT urlChanged(url);
}
void DolphinMainWindow::slotTerminalDirectoryChanged(const QUrl& url)
compareFilesAction->setEnabled(false);
}
- emit selectionChanged(selection);
+ Q_EMIT selectionChanged(selection);
}
void DolphinMainWindow::updateHistory()
updateSearchAction();
const QUrl url = viewContainer->url();
- emit urlChanged(url);
+ Q_EMIT urlChanged(url);
}
void DolphinMainWindow::tabCountChanged(int count)
updateWindowTitle();
}
- emit settingsChanged();
+ Q_EMIT settingsChanged();
}
void DolphinMainWindow::clearStatusBar()
void DolphinNewFileMenu::slotResult(KJob* job)
{
if (job->error()) {
- emit errorMessage(job->errorString());
+ Q_EMIT errorMessage(job->errorString());
} else {
KNewFileMenu::slotResult(job);
}
void DolphinPart::slotGoTriggered(QAction* action)
{
const QString url = action->data().toString();
- emit m_extension->openUrlRequest(QUrl(url));
+ Q_EMIT m_extension->openUrlRequest(QUrl(url));
}
void DolphinPart::slotSelectionChanged(const KFileItemList& selection)
if (!hasSelection) {
stateChanged(QStringLiteral("has_no_selection"));
- emit m_extension->enableAction("cut", false);
- emit m_extension->enableAction("copy", false);
+ Q_EMIT m_extension->enableAction("cut", false);
+ Q_EMIT m_extension->enableAction("copy", false);
deleteWithTrashShortcut->setEnabled(false);
editMimeTypeAction->setEnabled(false);
} else {
deleteWithTrashShortcut->setEnabled(capabilities.supportsDeleting() && !enableMoveToTrash);
editMimeTypeAction->setEnabled(true);
propertiesAction->setEnabled(true);
- emit m_extension->enableAction("cut", capabilities.supportsMoving());
- emit m_extension->enableAction("copy", true);
+ Q_EMIT m_extension->enableAction("cut", capabilities.supportsMoving());
+ Q_EMIT m_extension->enableAction("copy", true);
}
}
void DolphinPart::updatePasteAction()
{
QPair<bool, QString> pasteInfo = m_view->pasteInfo();
- emit m_extension->enableAction( "paste", pasteInfo.first );
- emit m_extension->setActionText( "paste", pasteInfo.second );
+ Q_EMIT m_extension->enableAction( "paste", pasteInfo.first );
+ Q_EMIT m_extension->setActionText( "paste", pasteInfo.second );
}
KAboutData* DolphinPart::createAboutData()
visibleUrl.setPath(visibleUrl.path() + '/' + m_nameFilter);
}
QString prettyUrl = visibleUrl.toDisplayString(QUrl::PreferLocalFile);
- emit setWindowCaption(prettyUrl);
- emit m_extension->setLocationBarUrl(prettyUrl);
- emit started(nullptr); // get the wheel to spin
+ Q_EMIT setWindowCaption(prettyUrl);
+ Q_EMIT m_extension->setLocationBarUrl(prettyUrl);
+ Q_EMIT started(nullptr); // get the wheel to spin
m_view->setNameFilter(m_nameFilter);
m_view->setUrl(url);
updatePasteAction();
- emit aboutToOpenURL();
+ Q_EMIT aboutToOpenURL();
if (reload)
m_view->reload();
// Disable "Find File" and "Open Terminal" actions for non-file URLs,
void DolphinPart::slotMessage(const QString& msg)
{
- emit setStatusBarText(msg);
+ Q_EMIT setStatusBarText(msg);
}
void DolphinPart::slotErrorMessage(const QString& msg)
{
qCDebug(DolphinDebug) << msg;
- emit canceled(msg);
+ Q_EMIT canceled(msg);
//KMessageBox::error(m_view, msg);
}
void DolphinPart::slotRequestItemInfo(const KFileItem& item)
{
- emit m_extension->mouseOverInfo(item);
+ Q_EMIT m_extension->mouseOverInfo(item);
if (item.isNull()) {
updateStatusBar();
} else {
const QString escapedText = Qt::convertFromPlainText(item.getStatusBarInfo());
- emit ReadOnlyPart::setStatusBarText(QStringLiteral("<qt>%1</qt>").arg(escapedText));
+ Q_EMIT ReadOnlyPart::setStatusBarText(QStringLiteral("<qt>%1</qt>").arg(escapedText));
}
}
// since the idea was not to need BrowserArguments for non-browser stuff...
KParts::BrowserArguments browserArgs;
browserArgs.trustedSource = true;
- emit m_extension->openUrlRequest(item.targetUrl(), args, browserArgs);
+ Q_EMIT m_extension->openUrlRequest(item.targetUrl(), args, browserArgs);
}
void DolphinPart::slotItemsActivated(const KFileItemList& items)
{
// TODO: Check issue N176832 for the missing QAIV signal; task 177399 - maybe this code
// should be moved into DolphinPart::slotItemActivated()
- emit m_extension->createNewWindow(url);
+ Q_EMIT m_extension->createNewWindow(url);
}
void DolphinPart::slotOpenContextMenu(const QPoint& pos,
actionGroups.insert(QStringLiteral("editactions"), editActions);
- emit m_extension->popupMenu(pos,
+ Q_EMIT m_extension->popupMenu(pos,
items,
KParts::OpenUrlArguments(),
KParts::BrowserArguments(),
if (oldUrl.matches(url(), QUrl::StripTrailingSlash /* #207572 */)) {
KParts::ReadOnlyPart::setUrl(newUrl);
const QString prettyUrl = newUrl.toDisplayString(QUrl::PreferLocalFile);
- emit m_extension->setLocationBarUrl(prettyUrl);
+ Q_EMIT m_extension->setLocationBarUrl(prettyUrl);
}
}
void DolphinPart::updateStatusBar()
{
const QString escapedText = Qt::convertFromPlainText(m_view->statusBarText());
- emit ReadOnlyPart::setStatusBarText(QStringLiteral("<qt>%1</qt>").arg(escapedText));
+ Q_EMIT ReadOnlyPart::setStatusBarText(QStringLiteral("<qt>%1</qt>").arg(escapedText));
}
void DolphinPart::updateProgress(int percent)
{
- emit m_extension->loadingProgress(percent);
+ Q_EMIT m_extension->loadingProgress(percent);
}
void DolphinPart::createDirectory()
void DolphinPartListingNotificationExtension::slotNewItems(const KFileItemList& items)
{
- emit listingEvent(KParts::ListingNotificationExtension::ItemsAdded, items);
+ Q_EMIT listingEvent(KParts::ListingNotificationExtension::ItemsAdded, items);
}
void DolphinPartListingNotificationExtension::slotItemsDeleted(const KFileItemList& items)
{
- emit listingEvent(KParts::ListingNotificationExtension::ItemsDeleted, items);
+ Q_EMIT listingEvent(KParts::ListingNotificationExtension::ItemsDeleted, items);
}
} else {
insertAction(menu()->actions().at(2), action);
}
- emit closedTabsCountChanged(menu()->actions().size() - 2);
+ Q_EMIT closedTabsCountChanged(menu()->actions().size() - 2);
// Assure that only up to 6 closed tabs are shown in the menu.
// 8 because of clear action + separator + 6 closed tabs
if (menu()->actions().size() > 8) {
for (int i = 2; i < count; ++i) {
removeAction(actions.at(i));
}
- emit closedTabsCountChanged(0);
+ Q_EMIT closedTabsCountChanged(0);
} else {
const QByteArray state = action->data().toByteArray();
removeAction(action);
delete action;
action = nullptr;
- emit restoreClosedTab(state);
- emit closedTabsCountChanged(menu()->actions().size() - 2);
+ Q_EMIT restoreClosedTab(state);
+ Q_EMIT closedTabsCountChanged(menu()->actions().size() - 2);
}
if (menu()->actions().count() <= 2) {
const int index = tabAt(event->pos());
if (index >= 0 && mimeData->hasUrls()) {
- emit tabDropEvent(index, event);
+ Q_EMIT tabDropEvent(index, event);
}
QTabBar::dropEvent(event);
if (index >= 0 && index == m_tabToBeClosedOnMiddleMouseButtonRelease
&& event->button() == Qt::MiddleButton) {
// Mouse middle click on a tab closes this tab.
- emit tabCloseRequested(index);
+ Q_EMIT tabCloseRequested(index);
return;
}
if (index < 0) {
// Double click on the empty tabbar area opens a new activated tab
// with the url from the current tab.
- emit openNewActivatedTab(currentIndex());
+ Q_EMIT openNewActivatedTab(currentIndex());
return;
}
QAction* selectedAction = menu.exec(event->globalPos());
if (selectedAction == newTabAction) {
- emit openNewActivatedTab(index);
+ Q_EMIT openNewActivatedTab(index);
} else if (selectedAction == detachTabAction) {
- emit tabDetachRequested(index);
+ Q_EMIT tabDetachRequested(index);
} else if (selectedAction == closeOtherTabsAction) {
const int tabCount = count();
for (int i = 0; i < index; i++) {
- emit tabCloseRequested(0);
+ Q_EMIT tabCloseRequested(0);
}
for (int i = index + 1; i < tabCount; i++) {
- emit tabCloseRequested(1);
+ Q_EMIT tabCloseRequested(1);
}
} else if (selectedAction == closeTabAction) {
- emit tabCloseRequested(index);
+ Q_EMIT tabCloseRequested(index);
}
return;
this, &DolphinTabPage::activeViewUrlChanged);
connect(newActiveView, &DolphinView::redirection,
this, &DolphinTabPage::slotViewUrlRedirection);
- emit activeViewChanged(activeViewContainer());
- emit activeViewUrlChanged(activeViewContainer()->url());
+ Q_EMIT activeViewChanged(activeViewContainer());
+ Q_EMIT activeViewUrlChanged(activeViewContainer()->url());
}
void DolphinTabPage::slotViewUrlRedirection(const QUrl& oldUrl, const QUrl& newUrl)
{
Q_UNUSED(oldUrl)
- emit activeViewUrlChanged(newUrl);
+ Q_EMIT activeViewUrlChanged(newUrl);
}
void DolphinTabPage::switchActiveView()
}
DolphinTabPage* tabPage = tabPageAt(index);
- emit rememberClosedTab(tabPage->activeViewContainer()->url(), tabPage->saveState());
+ Q_EMIT rememberClosedTab(tabPage->activeViewContainer()->url(), tabPage->saveState());
removeTab(index);
tabPage->deleteLater();
// Emit the currentUrlChanged signal if the url of the current tab has been changed.
if (index == currentIndex()) {
- emit currentUrlChanged(url);
+ Q_EMIT currentUrlChanged(url);
}
}
}
}
DolphinTabPage* tabPage = tabPageAt(index);
DolphinViewContainer* viewContainer = tabPage->activeViewContainer();
- emit activeViewChanged(viewContainer);
- emit currentUrlChanged(viewContainer->url());
+ Q_EMIT activeViewChanged(viewContainer);
+ Q_EMIT currentUrlChanged(viewContainer->url());
tabPage->setActive(true);
m_lastViewedTab = index;
}
tabBar()->show();
}
- emit tabCountChanged(count());
+ Q_EMIT tabCountChanged(count());
}
void DolphinTabWidget::tabRemoved(int index)
tabBar()->hide();
}
- emit tabCountChanged(count());
+ Q_EMIT tabCountChanged(count());
}
QString DolphinTabWidget::tabName(DolphinTabPage* tabPage) const
m_searchModeEnabled = enabled;
- emit searchModeEnabledChanged(enabled);
+ Q_EMIT searchModeEnabledChanged(enabled);
}
bool DolphinViewContainer::isSearchModeEnabled() const
{
m_filterBar->closeFilterBar();
m_view->setFocus();
- emit showFilterBarChanged(false);
+ Q_EMIT showFilterBarChanged(false);
}
void DolphinViewContainer::setNameFilter(const QString& nameFilter)
switch (event->key()) {
case Qt::Key_Escape:
if (m_filterInput->text().isEmpty()) {
- emit closeRequest();
+ Q_EMIT closeRequest();
} else {
m_filterInput->clear();
}
case Qt::Key_Enter:
case Qt::Key_Return:
- emit focusViewRequest();
+ Q_EMIT focusViewRequest();
break;
default:
m_itemData[i]->values = retrieveData(m_itemData.at(i)->item, m_itemData.at(i)->parent);
}
- emit itemsChanged(KItemRangeList() << KItemRange(0, count()), changedRoles);
+ Q_EMIT itemsChanged(KItemRangeList() << KItemRange(0, count()), changedRoles);
}
// Clear the 'values' of all filtered items. They will be re-populated with the
movedToIndexes.append(newIndex);
}
- emit itemsMoved(KItemRange(firstMovedIndex, movedItemsCount), movedToIndexes);
+ Q_EMIT itemsMoved(KItemRange(firstMovedIndex, movedItemsCount), movedToIndexes);
} else if (groupedSorting()) {
// The groups might have changed even if the order of the items has not.
const QList<QPair<int, QVariant> > oldGroups = m_groups;
m_groups.clear();
if (groups() != oldGroups) {
- emit groupsChanged();
+ Q_EMIT groupsChanged();
}
}
m_urlsToExpand.clear();
}
- emit directoryLoadingCompleted();
+ Q_EMIT directoryLoadingCompleted();
}
void KFileItemModel::slotCanceled()
m_maximumUpdateIntervalTimer->stop();
dispatchPendingItemsToInsert();
- emit directoryLoadingCanceled();
+ Q_EMIT directoryLoadingCanceled();
}
void KFileItemModel::slotItemsAdded(const QUrl &directoryUrl, const KFileItemList& items)
qDeleteAll(m_itemData);
m_itemData.clear();
m_items.clear();
- emit itemsRemoved(KItemRangeList() << KItemRange(0, removedCount));
+ Q_EMIT itemsRemoved(KItemRangeList() << KItemRange(0, removedCount));
}
m_expandedDirs.clear();
// It will be re-populated with the updated indices if index(const QUrl&) is called.
m_items.clear();
- emit itemsInserted(itemRanges);
+ Q_EMIT itemsInserted(itemRanges);
#ifdef KFILEITEMMODEL_DEBUG
qCDebug(DolphinDebug) << "[TIME] Inserting of" << newItems.count() << "items:" << timer.elapsed();
// It will be re-populated with the updated indices if index(const QUrl&) is called.
m_items.clear();
- emit itemsRemoved(itemRanges);
+ Q_EMIT itemsRemoved(itemRanges);
}
QList<KFileItemModel::ItemData*> KFileItemModel::createItemDataList(const QUrl& parentUrl, const KFileItemList& items) const
void KFileItemModel::emitItemsChangedAndTriggerResorting(const KItemRangeList& itemRanges, const QSet<QByteArray>& changedRoles)
{
- emit itemsChanged(itemRanges, changedRoles);
+ Q_EMIT itemsChanged(itemRanges, changedRoles);
// Trigger a resorting if necessary. Note that this can happen even if the sort
// role has not changed at all because the file name can be used as a fallback.
resortAllItems();
}
- emit directorySortingProgress(100);
+ Q_EMIT directorySortingProgress(100);
} else if (itemCount > 0) {
resolvedCount = qBound(0, resolvedCount, itemCount);
const int progress = resolvedCount * 100 / itemCount;
if (m_sortingProgressPercent != progress) {
m_sortingProgressPercent = progress;
- emit directorySortingProgress(progress);
+ Q_EMIT directorySortingProgress(progress);
}
}
}
m_selectionManager->setModel(m_model);
- emit modelChanged(m_model, oldModel);
+ Q_EMIT modelChanged(m_model, oldModel);
}
KItemModelBase* KItemListController::model() const
updateExtendedSelectionRegion();
}
- emit viewChanged(m_view, oldView);
+ Q_EMIT viewChanged(m_view, oldView);
}
KItemListView* KItemListController::view() const
case Qt::Key_Return: {
const KItemSet selectedItems = m_selectionManager->selectedItems();
if (selectedItems.count() >= 2) {
- emit itemsActivated(selectedItems);
+ Q_EMIT itemsActivated(selectedItems);
} else if (selectedItems.count() == 1) {
- emit itemActivated(selectedItems.first());
+ Q_EMIT itemActivated(selectedItems.first());
} else {
- emit itemActivated(index);
+ Q_EMIT itemActivated(index);
}
break;
}
if (index >= 0) {
const QRectF contextRect = m_view->itemContextRect(index);
const QPointF pos(m_view->scene()->views().first()->mapToGlobal(contextRect.bottomRight().toPoint()));
- emit itemContextMenuRequested(index, pos);
+ Q_EMIT itemContextMenuRequested(index, pos);
} else {
- emit viewContextMenuRequested(QCursor::pos());
+ Q_EMIT viewContextMenuRequested(QCursor::pos());
}
break;
}
m_selectionManager->clearSelection();
}
m_keyboardManager->cancelSearch();
- emit escapePressed();
+ Q_EMIT escapePressed();
break;
case Qt::Key_Space:
const bool expanded = m_model->isExpanded(index);
m_model->setExpanded(index, !expanded);
} else if (m_autoActivationBehavior != ExpansionOnly) {
- emit itemActivated(index);
+ Q_EMIT itemActivated(index);
}
}
}
return false;
}
- emit mouseButtonReleased(m_pressedIndex, event->buttons());
+ Q_EMIT mouseButtonReleased(m_pressedIndex, event->buttons());
return onRelease(transform.map(event->pos()), event->modifiers(), event->button(), false);
}
m_selectionManager->clearSelection();
if (index >= 0) {
m_selectionManager->setSelected(index);
- emit itemContextMenuRequested(index, event->screenPos());
+ Q_EMIT itemContextMenuRequested(index, event->screenPos());
} else {
const QRectF headerBounds = m_view->headerBoundaries();
if (headerBounds.contains(event->pos())) {
- emit headerContextMenuRequested(event->screenPos());
+ Q_EMIT headerContextMenuRequested(event->screenPos());
} else {
- emit viewContextMenuRequested(event->screenPos());
+ Q_EMIT viewContextMenuRequested(event->screenPos());
}
}
return true;
(event->button() & Qt::LeftButton) &&
index >= 0 && index < m_model->count();
if (emitItemActivated) {
- emit itemActivated(index);
+ Q_EMIT itemActivated(index);
}
return false;
}
KItemListWidget* widget = hoveredWidget();
if (widget) {
widget->setHovered(false);
- emit itemUnhovered(widget->index());
+ Q_EMIT itemUnhovered(widget->index());
}
return false;
}
if (oldHoveredWidget) {
oldHoveredWidget->setHovered(false);
- emit itemUnhovered(oldHoveredWidget->index());
+ Q_EMIT itemUnhovered(oldHoveredWidget->index());
}
}
m_view->hideDropIndicator();
if (!newHoveredWidget->isHovered()) {
newHoveredWidget->setHovered(true);
- emit itemHovered(index);
+ Q_EMIT itemHovered(index);
}
if (!m_autoActivationTimer->isActive() && m_autoActivationTimer->interval() >= 0) {
m_autoActivationTimer->stop();
if (newHoveredWidget && newHoveredWidget->isHovered()) {
newHoveredWidget->setHovered(false);
- emit itemUnhovered(index);
+ Q_EMIT itemUnhovered(index);
}
}
} else {
if (dropAboveIndex >= 0) {
// Something has been dropped between two items.
m_view->hideDropIndicator();
- emit aboveItemDropEvent(dropAboveIndex, event);
+ Q_EMIT aboveItemDropEvent(dropAboveIndex, event);
} else if (!event->mimeData()->hasFormat(m_model->blacklistItemDropEventMimeType())) {
// Something has been dropped on an item or on an empty part of the view.
- emit itemDropEvent(m_view->itemAt(pos), event);
+ Q_EMIT itemDropEvent(m_view->itemAt(pos), event);
}
QAccessibleEvent accessibilityEvent(view(), QAccessible::DragDropEnd);
if (oldHoveredWidget != newHoveredWidget) {
if (oldHoveredWidget) {
oldHoveredWidget->setHovered(false);
- emit itemUnhovered(oldHoveredWidget->index());
+ Q_EMIT itemUnhovered(oldHoveredWidget->index());
}
if (newHoveredWidget) {
newHoveredWidget->setHovered(true);
const QPointF mappedPos = newHoveredWidget->mapFromItem(m_view, pos);
newHoveredWidget->setHoverPosition(mappedPos);
- emit itemHovered(newHoveredWidget->index());
+ Q_EMIT itemHovered(newHoveredWidget->index());
}
} else if (oldHoveredWidget) {
const QPointF mappedPos = oldHoveredWidget->mapFromItem(m_view, pos);
for (KItemListWidget* widget : widgets) {
if (widget->isHovered()) {
widget->setHovered(false);
- emit itemUnhovered(widget->index());
+ Q_EMIT itemUnhovered(widget->index());
}
}
return false;
startRubberBand();
}
- emit scrollerStop();
+ Q_EMIT scrollerStop();
m_view->m_tapAndHoldIndicator->setStartPosition(m_pressedMousePos);
m_view->m_tapAndHoldIndicator->setActive(true);
}
counter = counter + (pinch->scaleFactor() - 1);
if (counter >= sensitivityModifier) {
- emit increaseZoom();
+ Q_EMIT increaseZoom();
counter = 0;
} else if (counter <= -sensitivityModifier) {
- emit decreaseZoom();
+ Q_EMIT decreaseZoom();
counter = 0;
}
}
}
if (swipe->state() == Qt::GestureFinished) {
- emit scrollerStop();
+ Q_EMIT scrollerStop();
if (swipe->swipeAngle() <= 20 || swipe->swipeAngle() >= 340) {
- emit mouseButtonPressed(m_pressedIndex, Qt::BackButton);
+ Q_EMIT mouseButtonPressed(m_pressedIndex, Qt::BackButton);
} else if (swipe->swipeAngle() <= 200 && swipe->swipeAngle() >= 160) {
- emit mouseButtonPressed(m_pressedIndex, Qt::ForwardButton);
+ Q_EMIT mouseButtonPressed(m_pressedIndex, Qt::ForwardButton);
} else if (swipe->swipeAngle() <= 110 && swipe->swipeAngle() >= 60) {
- emit swipeUp();
+ Q_EMIT swipeUp();
}
m_isSwipeGesture = true;
}
bool KItemListController::onPress(const QPoint& screenPos, const QPointF& pos, const Qt::KeyboardModifiers modifiers, const Qt::MouseButtons buttons)
{
- emit mouseButtonPressed(m_pressedIndex, buttons);
+ Q_EMIT mouseButtonPressed(m_pressedIndex, buttons);
if (buttons & (Qt::BackButton | Qt::ForwardButton)) {
// Do not select items when clicking the back/forward buttons, see
m_clearSelectionIfItemsAreNotDragged = true;
if (m_selectionManager->selectedItems().count() == 1 && m_view->isAboveText(m_pressedIndex, m_pressedMousePos)) {
- emit selectedItemTextPressed(m_pressedIndex);
+ Q_EMIT selectedItemTextPressed(m_pressedIndex);
}
}
}
if (buttons & Qt::RightButton) {
- emit itemContextMenuRequested(m_pressedIndex, screenPos);
+ Q_EMIT itemContextMenuRequested(m_pressedIndex, screenPos);
}
return true;
if (buttons & Qt::RightButton) {
const QRectF headerBounds = m_view->headerBoundaries();
if (headerBounds.contains(pos)) {
- emit headerContextMenuRequested(screenPos);
+ Q_EMIT headerContextMenuRequested(screenPos);
} else {
- emit viewContextMenuRequested(screenPos);
+ Q_EMIT viewContextMenuRequested(screenPos);
}
return true;
}
const bool expanded = m_model->isExpanded(index);
m_model->setExpanded(index, !expanded);
- emit itemExpansionToggleClicked(index);
+ Q_EMIT itemExpansionToggleClicked(index);
emitItemActivated = false;
} else if (shiftOrControlPressed) {
// The mouse click should only update the selection, not trigger the item
}
}
if (emitItemActivated) {
- emit itemActivated(index);
+ Q_EMIT itemActivated(index);
}
} else if (buttons & Qt::MiddleButton) {
- emit itemMiddleClicked(index);
+ Q_EMIT itemMiddleClicked(index);
}
}
}
if (m_currentItem != previous) {
- emit currentChanged(m_currentItem, previous);
+ Q_EMIT currentChanged(m_currentItem, previous);
if (m_isAnchoredSelectionActive) {
const KItemSet selection = selectedItems();
if (selection != previousSelection) {
- emit selectionChanged(selection, previousSelection);
+ Q_EMIT selectionChanged(selection, previousSelection);
}
}
}
if (m_selectedItems != items) {
const KItemSet previous = m_selectedItems;
m_selectedItems = items;
- emit selectionChanged(m_selectedItems, previous);
+ Q_EMIT selectionChanged(m_selectedItems, previous);
}
}
const KItemSet selection = selectedItems();
if (selection != previous) {
- emit selectionChanged(selection, previous);
+ Q_EMIT selectionChanged(selection, previous);
}
}
if (!previous.isEmpty()) {
m_selectedItems.clear();
m_isAnchoredSelectionActive = false;
- emit selectionChanged(KItemSet(), previous);
+ Q_EMIT selectionChanged(KItemSet(), previous);
}
}
if (m_currentItem >= m_model->count()) {
m_currentItem = -1;
}
- emit currentChanged(m_currentItem, previousCurrent);
+ Q_EMIT currentChanged(m_currentItem, previousCurrent);
}
// Update the anchor item
const KItemSet selection = selectedItems();
if (selection != previousSelection) {
- emit selectionChanged(selection, previousSelection);
+ Q_EMIT selectionChanged(selection, previousSelection);
}
}
// Update the current item
m_currentItem = indexAfterRangesRemoving(m_currentItem, itemRanges, DiscardRemovedIndex);
if (m_currentItem != previousCurrent) {
- emit currentChanged(m_currentItem, previousCurrent);
+ Q_EMIT currentChanged(m_currentItem, previousCurrent);
if (m_currentItem < 0) {
// Calling setCurrentItem() would trigger the selectionChanged signal, but we want to
// emit it only once in this function -> change the current item manually and emit currentChanged
m_currentItem = indexAfterRangesRemoving(previousCurrent, itemRanges, AdjustRemovedIndex);
- emit currentChanged(m_currentItem, -1);
+ Q_EMIT currentChanged(m_currentItem, -1);
}
}
const KItemSet selection = selectedItems();
if (selection != previousSelection) {
- emit selectionChanged(selection, previousSelection);
+ Q_EMIT selectionChanged(selection, previousSelection);
}
Q_ASSERT(m_currentItem < m_model->count());
// Calling setCurrentItem would trigger the selectionChanged signal, but we want to
// emit it only once in this function -> change the current item manually and emit currentChanged
m_currentItem = newCurrentItem;
- emit currentChanged(newCurrentItem, previousCurrentItem);
+ Q_EMIT currentChanged(newCurrentItem, previousCurrentItem);
}
// Start a new anchored selection.
const KItemSet selection = selectedItems();
if (selection != previousSelection) {
- emit selectionChanged(selection, previousSelection);
+ Q_EMIT selectionChanged(selection, previousSelection);
}
}
}
if (newOffset != scrollOffset()) {
- emit scrollTo(newOffset);
+ Q_EMIT scrollTo(newOffset);
}
}
}
doLayout(NoAnimation);
onScrollOrientationChanged(orientation, previousOrientation);
- emit scrollOrientationChanged(orientation, previousOrientation);
+ Q_EMIT scrollOrientationChanged(orientation, previousOrientation);
}
Qt::Orientation KItemListView::scrollOrientation() const
setVisibleRoles(current);
- emit visibleRolesChanged(current, previous);
+ Q_EMIT visibleRolesChanged(current, previous);
}
void KItemListView::triggerAutoScrolling()
{
disconnectRoleEditingSignals(index);
- emit roleEditingCanceled(index, role, value);
+ Q_EMIT roleEditingCanceled(index, role, value);
m_editingRole = false;
}
{
disconnectRoleEditingSignals(index);
- emit roleEditingFinished(index, role, value);
+ Q_EMIT roleEditingFinished(index, role, value);
m_editingRole = false;
}
{
const qreal newScrollOffset = m_layouter->scrollOffset();
if (m_oldScrollOffset != newScrollOffset) {
- emit scrollOffsetChanged(newScrollOffset, m_oldScrollOffset);
+ Q_EMIT scrollOffsetChanged(newScrollOffset, m_oldScrollOffset);
m_oldScrollOffset = newScrollOffset;
}
const qreal newMaximumScrollOffset = m_layouter->maximumScrollOffset();
if (m_oldMaximumScrollOffset != newMaximumScrollOffset) {
- emit maximumScrollOffsetChanged(newMaximumScrollOffset, m_oldMaximumScrollOffset);
+ Q_EMIT maximumScrollOffsetChanged(newMaximumScrollOffset, m_oldMaximumScrollOffset);
m_oldMaximumScrollOffset = newMaximumScrollOffset;
}
const qreal newItemOffset = m_layouter->itemOffset();
if (m_oldItemOffset != newItemOffset) {
- emit itemOffsetChanged(newItemOffset, m_oldItemOffset);
+ Q_EMIT itemOffsetChanged(newItemOffset, m_oldItemOffset);
m_oldItemOffset = newItemOffset;
}
const qreal newMaximumItemOffset = m_layouter->maximumItemOffset();
if (m_oldMaximumItemOffset != newMaximumItemOffset) {
- emit maximumItemOffsetChanged(newMaximumItemOffset, m_oldMaximumItemOffset);
+ Q_EMIT maximumItemOffsetChanged(newMaximumItemOffset, m_oldMaximumItemOffset);
m_oldMaximumItemOffset = newMaximumItemOffset;
}
}
if (m_groupedSorting != grouped) {
m_groupedSorting = grouped;
onGroupedSortingChanged(grouped);
- emit groupedSortingChanged(grouped);
+ Q_EMIT groupedSortingChanged(grouped);
}
}
const QByteArray previous = m_sortRole;
m_sortRole = role;
onSortRoleChanged(role, previous, resortItems);
- emit sortRoleChanged(role, previous);
+ Q_EMIT sortRoleChanged(role, previous);
}
}
const Qt::SortOrder previous = m_sortOrder;
m_sortOrder = order;
onSortOrderChanged(order, previous);
- emit sortOrderChanged(order, previous);
+ Q_EMIT sortOrderChanged(order, previous);
}
}
QSet<QByteArray> changedRoles;
changedRoles.insert(role);
m_model->onItemChanged(index, changedRoles);
- emit m_model->itemsChanged(KItemRangeList() << KItemRange(index, 1), changedRoles);
+ Q_EMIT m_model->itemsChanged(KItemRangeList() << KItemRange(index, 1), changedRoles);
}
}
QGraphicsView* parent = scene()->views()[0];
if (current.isEmpty() || !parent || current != "text") {
if (m_roleEditor) {
- emit roleEditingCanceled(index(), current, data().value(current));
+ Q_EMIT roleEditingCanceled(index(), current, data().value(current));
disconnect(m_roleEditor, &KItemListRoleEditor::roleEditingCanceled,
this, &KStandardItemListWidget::slotRoleEditingCanceled);
const QVariant& value)
{
closeRoleEditor();
- emit roleEditingCanceled(index(), role, value);
+ Q_EMIT roleEditingCanceled(index(), role, value);
setEditedRole(QByteArray());
}
const QVariant& value)
{
closeRoleEditor();
- emit roleEditingFinished(index(), role, value);
+ Q_EMIT roleEditingFinished(index(), role, value);
setEditedRole(QByteArray());
}
// TODO: no hierarchical items are handled yet
onItemInserted(index);
- emit itemsInserted(KItemRangeList() << KItemRange(index, 1));
+ Q_EMIT itemsInserted(KItemRangeList() << KItemRange(index, 1));
}
}
m_indexesForItems.insert(item, index);
onItemChanged(index, changedRoles);
- emit itemsChanged(KItemRangeList() << KItemRange(index, 1), changedRoles);
+ Q_EMIT itemsChanged(KItemRangeList() << KItemRange(index, 1), changedRoles);
}
void KStandardItemModel::removeItem(int index)
item->deleteLater();
item = nullptr;
- emit itemsRemoved(KItemRangeList() << KItemRange(index, 1));
+ Q_EMIT itemsRemoved(KItemRangeList() << KItemRange(index, 1));
// TODO: no hierarchical items are handled yet
}
m_items.clear();
m_indexesForItems.clear();
- emit itemsRemoved(KItemRangeList() << KItemRange(0, size));
+ Q_EMIT itemsRemoved(KItemRangeList() << KItemRange(0, size));
}
KStandardItem* KStandardItemModel::item(int index) const
}
// sends the results
- emit result(resolvedPath, count, size);
+ Q_EMIT result(resolvedPath, count, size);
}
void KDirectoryContentsCounter::slotDirWatchDirty(const QString& path)
// fast path when in cache
// will be updated later if result has changed
const auto pair = s_cache->value(path);
- emit result(path, pair.first, pair.second);
+ Q_EMIT result(path, pair.first, pair.second);
}
if (m_workerIsBusy) {
options |= KDirectoryContentsCounterWorker::CountDirectoriesOnly;
}
- emit requestDirectoryContentsCount(path, options);
+ Q_EMIT requestDirectoryContentsCount(path, options);
m_workerIsBusy = true;
}
}
void KDirectoryContentsCounterWorker::countDirectoryContents(const QString& path, Options options)
{
auto res = subItemsCount(path, options);
- emit result(path, res.count, res.size);
+ Q_EMIT result(path, res.count, res.size);
}
// mimeData can be 0 according to https://bugs.kde.org/show_bug.cgi?id=335053
if (!mimeData) {
m_cutItems.clear();
- emit cutItemsChanged();
+ Q_EMIT cutItemsChanged();
return;
}
} else {
m_cutItems.clear();
}
- emit cutItemsChanged();
+ Q_EMIT cutItemsChanged();
}
KFileItemClipboard::KFileItemClipboard() :
void KFileItemModelDirLister::handleError(KIO::Job* job)
{
if (job->error() == KIO::ERR_IS_FILE) {
- emit urlIsFileError(url());
+ Q_EMIT urlIsFileError(url());
} else {
const QString errorString = job->errorString();
if (errorString.isEmpty()) {
- emit errorMessage(i18nc("@info:status", "Unknown error."));
+ Q_EMIT errorMessage(i18nc("@info:status", "Unknown error."));
} else {
- emit errorMessage(errorString);
+ Q_EMIT errorMessage(errorString);
}
}
}
const Qt::SortOrder current = (m_model->sortOrder() == Qt::AscendingOrder) ?
Qt::DescendingOrder : Qt::AscendingOrder;
m_model->setSortOrder(current);
- emit sortOrderChanged(current, previous);
+ Q_EMIT sortOrderChanged(current, previous);
} else {
// Change the sort role and reset to the ascending order
const QByteArray previous = m_model->sortRole();
const QByteArray current = m_columns[m_pressedRoleIndex];
const bool resetSortOrder = m_model->sortOrder() == Qt::DescendingOrder;
m_model->setSortRole(current, !resetSortOrder);
- emit sortRoleChanged(current, previous);
+ Q_EMIT sortRoleChanged(current, previous);
if (resetSortOrder) {
m_model->setSortOrder(Qt::AscendingOrder);
- emit sortOrderChanged(Qt::AscendingOrder, Qt::DescendingOrder);
+ Q_EMIT sortOrderChanged(Qt::AscendingOrder, Qt::DescendingOrder);
}
}
break;
case ResizeRoleOperation: {
const QByteArray pressedRole = m_columns[m_pressedRoleIndex];
const qreal currentWidth = m_columnWidths.value(pressedRole);
- emit columnWidthChangeFinished(pressedRole, currentWidth);
+ Q_EMIT columnWidthChangeFinished(pressedRole, currentWidth);
break;
}
m_columnWidths.insert(pressedRole, currentWidth);
update();
- emit columnWidthChanged(pressedRole, currentWidth, previousWidth);
+ Q_EMIT columnWidthChanged(pressedRole, currentWidth, previousWidth);
break;
}
const QByteArray role = m_columns[m_movingRole.index];
const int previousIndex = m_movingRole.index;
m_movingRole.index = targetIndex;
- emit columnMoved(role, targetIndex, previousIndex);
+ Q_EMIT columnMoved(role, targetIndex, previousIndex);
m_movingRole.xDec = event->pos().x() - roleXPosition(role);
}
setColumnWidth(role, preferredColumnWidth(role));
qreal currentWidth = columnWidth(role);
- emit columnWidthChanged(role, currentWidth, previousWidth);
- emit columnWidthChangeFinished(role, currentWidth);
+ Q_EMIT columnWidthChanged(role, currentWidth, previousWidth);
+ Q_EMIT columnWidthChangeFinished(role, currentWidth);
}
}
// loosing keyboard search context basically
m_isSearchRestarted = false;
- emit changeCurrentItem(sameKey ? firstKey : m_searchedString, searchFromNextItem);
+ Q_EMIT changeCurrentItem(sameKey ? firstKey : m_searchedString, searchFromNextItem);
}
m_keyboardInputTime.start();
}
// a roleEditingFinished signal (see KItemListRoleEditor::event),
// which is not wanted in this case.
m_blockFinishedSignal = true;
- emit roleEditingCanceled(m_role, KIO::encodeFileName(toPlainText()));
+ Q_EMIT roleEditingCanceled(m_role, KIO::encodeFileName(toPlainText()));
m_blockFinishedSignal = false;
event->accept();
return;
void KItemListRoleEditor::emitRoleEditingFinished()
{
if (!m_blockFinishedSignal) {
- emit roleEditingFinished(m_role, KIO::encodeFileName(toPlainText()));
+ Q_EMIT roleEditingFinished(m_role, KIO::encodeFileName(toPlainText()));
}
}
if (m_startPos != pos) {
const QPointF previous = m_startPos;
m_startPos = pos;
- emit startPositionChanged(m_startPos, previous);
+ Q_EMIT startPositionChanged(m_startPos, previous);
}
}
}
}
- emit endPositionChanged(m_endPos, previous);
+ Q_EMIT endPositionChanged(m_endPos, previous);
}
}
{
if (m_active != active) {
m_active = active;
- emit activationChanged(active);
+ Q_EMIT activationChanged(active);
}
}
m_animation[type].remove(widget);
delete propertyAnim;
- emit finished(widget, type);
+ Q_EMIT finished(widget, type);
}
}
it.remove();
finishedAnim->deleteLater();
- emit finished(widget, static_cast<AnimationType>(type));
+ Q_EMIT finished(widget, static_cast<AnimationType>(type));
return;
}
}
m_lastMiddlePressedAction = action;
} else if (event->type() == QEvent::MouseButtonRelease) {
if (m_lastMiddlePressedAction == action) {
- emit actionMiddleClicked(action);
+ Q_EMIT actionMiddleClicked(action);
}
m_lastMiddlePressedAction = nullptr;
}
m_lastMiddlePressedAction = action;
} else if (event->type() == QEvent::MouseButtonRelease) {
if (m_lastMiddlePressedAction == action) {
- emit actionMiddleClicked(action);
+ Q_EMIT actionMiddleClicked(action);
return true;
}
m_lastMiddlePressedAction = nullptr;
{
const KFileItem item = m_model->fileItem(index);
if (!item.isNull()) {
- emit folderActivated(item.url());
+ Q_EMIT folderActivated(item.url());
}
}
{
const KFileItem item = m_model->fileItem(index);
if (!item.isNull()) {
- emit folderMiddleClicked(item.url());
+ Q_EMIT folderMiddleClicked(item.url());
}
}
KIO::DropJob *job = DragAndDropHelper::dropUrls(destItem.mostLocalUrl(), &dropEvent, this);
if (job) {
- connect(job, &KIO::DropJob::result, this, [this](KJob *job) { if (job->error()) emit errorMessage(job->errorString()); });
+ connect(job, &KIO::DropJob::result, this, [this](KJob *job) { if (job->error()) Q_EMIT errorMessage(job->errorString()); });
}
}
}
const int index = m_model->index(url);
if (jumpHome) {
- emit folderActivated(baseUrl);
+ Q_EMIT folderActivated(baseUrl);
} else if (index >= 0) {
updateCurrentItem(index);
} else if (url == baseUrl) {
m_metaDataWidget->setConfigurationMode(Baloo::ConfigurationMode::Accept);
m_configureButtons->setVisible(false);
m_configureLabel->setVisible(false);
- emit configurationFinished();
+ Q_EMIT configurationFinished();
}
);
connect(m_configureButtons, &QDialogButtonBox::rejected, this, [this]() {
m_metaDataWidget->setConfigurationMode(Baloo::ConfigurationMode::Cancel);
m_configureButtons->setVisible(false);
m_configureLabel->setVisible(false);
- emit configurationFinished();
+ Q_EMIT configurationFinished();
}
);
if (tap) {
if (tap->state() == Qt::GestureFinished) {
- emit contextMenuRequested(tap->position().toPoint());
+ Q_EMIT contextMenuRequested(tap->position().toPoint());
}
event->accept();
return true;
}
if (m_isVideo) {
- emit hasVideoChanged(true);
+ Q_EMIT hasVideoChanged(true);
}
if (m_url != m_media->currentSource().url()) {
{
if (m_isVideo) {
m_videoPlayer->hide();
- emit hasVideoChanged(false);
+ Q_EMIT hasVideoChanged(false);
}
}
if (m_media) {
m_media->stop();
m_videoPlayer->hide();
- emit hasVideoChanged(false);
+ Q_EMIT hasVideoChanged(false);
}
}
} else {
const QString label = item->text();
const QString message = i18nc("@info", "The device '%1' is not a disk and cannot be ejected.", label);
- emit errorMessage(message);
+ Q_EMIT errorMessage(message);
}
}
}
// after we have emitted PlacesItemModel::storageTearDownRequested
disconnect(tmp, &Solid::StorageAccess::teardownRequested,
item->signalHandler(), &PlacesItemSignalHandler::onTearDownRequested);
- emit storageTearDownRequested(tmp->filePath());
+ Q_EMIT storageTearDownRequested(tmp->filePath());
}
}
}
"One or more files on this device are opened in following applications: <application>%2</application>.",
blockingApps.count(), blockingApps.join(i18nc("separator in list of apps blocking device unmount", ", ")));
}
- emit errorMessage(errorString);
+ Q_EMIT errorMessage(errorString);
});
listOpenFilesJob->start();
} else {
- emit errorMessage(errorData.toString());
+ Q_EMIT errorMessage(errorData.toString());
}
} else {
// No error; it must have been unmounted successfully
if (error != Solid::NoError) {
if (errorData.isValid()) {
- emit errorMessage(i18nc("@info", "An error occurred while accessing '%1', the system responded: %2",
+ Q_EMIT errorMessage(i18nc("@info", "An error occurred while accessing '%1', the system responded: %2",
item->text(),
errorData.toString()));
} else {
- emit errorMessage(i18nc("@info", "An error occurred while accessing '%1'",
+ Q_EMIT errorMessage(i18nc("@info", "An error occurred while accessing '%1'",
item->text()));
}
- emit storageSetupDone(index, false);
+ Q_EMIT storageSetupDone(index, false);
} else {
- emit storageSetupDone(index, true);
+ Q_EMIT storageSetupDone(index, true);
}
}
if (m_item) {
Solid::StorageAccess *tmp = m_item->device().as<Solid::StorageAccess>();
if (tmp) {
- emit tearDownExternallyRequested(tmp->filePath());
+ Q_EMIT tearDownExternallyRequested(tmp->filePath());
}
}
}
{
KIO::DropJob *job = DragAndDropHelper::dropUrls(dest, event, parent);
if (job) {
- connect(job, &KIO::DropJob::result, this, [this](KJob *job) { if (job->error()) emit errorMessage(job->errorString()); });
+ connect(job, &KIO::DropJob::result, this, [this](KJob *job) { if (job->error()) Q_EMIT errorMessage(job->errorString()); });
}
}
const QUrl url = m_model->data(index).value("url").toUrl();
if (!url.isEmpty()) {
if (button == Qt::MiddleButton) {
- emit placeMiddleClicked(KFilePlacesModel::convertedUrl(url));
+ Q_EMIT placeMiddleClicked(KFilePlacesModel::convertedUrl(url));
} else {
- emit placeActivated(KFilePlacesModel::convertedUrl(url));
+ Q_EMIT placeActivated(KFilePlacesModel::convertedUrl(url));
}
}
}
void PlacesPanel::showHiddenEntries(bool shown)
{
m_model->setHiddenItemsShown(shown);
- emit showHiddenEntriesChanged(shown);
+ Q_EMIT showHiddenEntriesChanged(shown);
}
int PlacesPanel::hiddenListCount()
void TerminalPanel::terminalExited()
{
m_terminal = nullptr;
- emit hideTerminalPanel();
+ Q_EMIT hideTerminalPanel();
}
bool TerminalPanel::isHiddenInVisibleWindow() const
KMountPoint::Ptr mountPoint = KMountPoint::currentMountPoints().findByPath(m_konsolePartCurrentDirectory);
if (mountPoint && mountPoint->mountType() != QStringLiteral("fuse.kio-fuse")) {
// Not in KIOFUse mount, so just switch to the corresponding URL.
- emit changeUrl(url);
+ Q_EMIT changeUrl(url);
return;
}
watcher->deleteLater();
if (reply.isError()) {
// KIOFuse errored out... just show the normal URL
- emit changeUrl(url);
+ Q_EMIT changeUrl(url);
} else {
// Our location happens to be in a KIOFuse mount and is mounted.
// Let's change the DolphinView to point to the remote URL equivalent.
- emit changeUrl(QUrl::fromUserInput(reply.value()));
+ Q_EMIT changeUrl(QUrl::fromUserInput(reply.value()));
}
});
}
} else {
removeSearchTag(tagName);
}
- emit facetChanged();
+ Q_EMIT facetChanged();
if (!onlyOneTag) {
m_tagsSelector->menu()->show();
m_active = active;
if (active) {
- emit activated();
+ Q_EMIT activated();
}
}
}
QWidget::keyReleaseEvent(event);
if (event->key() == Qt::Key_Escape) {
if (m_searchInput->text().isEmpty()) {
- emit closeRequest();
+ Q_EMIT closeRequest();
} else {
m_searchInput->clear();
}
}
else if (event->key() == Qt::Key_Down) {
- emit focusViewRequest();
+ Q_EMIT focusViewRequest();
}
}
m_startSearchTimer->stop();
m_startedSearching = true;
m_saveSearchAction->setEnabled(true);
- emit searchRequest();
+ Q_EMIT searchRequest();
}
void DolphinSearchBox::emitCloseRequest()
m_startSearchTimer->stop();
m_startedSearching = false;
m_saveSearchAction->setEnabled(false);
- emit closeRequest();
+ Q_EMIT closeRequest();
}
void DolphinSearchBox::slotConfigurationChanged()
} else {
m_startSearchTimer->start();
}
- emit searchTextChanged(text);
+ Q_EMIT searchTextChanged(text);
}
void DolphinSearchBox::slotReturnPressed()
{
emitSearchRequest();
- emit focusViewRequest();
+ Q_EMIT focusViewRequest();
}
void DolphinSearchBox::slotFacetChanged()
{
m_startedSearching = true;
m_startSearchTimer->stop();
- emit searchRequest();
+ Q_EMIT searchRequest();
}
void DolphinSearchBox::slotSearchSaved()
page->applySettings();
}
- emit settingsChanged();
+ Q_EMIT settingsChanged();
GeneralSettings* settings = GeneralSettings::self();
if (settings->modifiedStartupSettings()) {
void ServiceItemDelegate::slotConfigureButtonClicked()
{
- emit requestServiceConfiguration(focusedIndex());
+ Q_EMIT requestServiceConfiguration(focusedIndex());
}
return false;
}
- emit dataChanged(index, index);
+ Q_EMIT dataChanged(index, index);
return true;
}
// Enable and disable home URL controls appropriately
updateInitialViewOptions();
- emit changed();
+ Q_EMIT changed();
}
void StartupSettingsPage::updateInitialViewOptions()
if (ok) {
m_customFont = font;
m_modeCombo->setFont(m_customFont);
- emit changed();
+ Q_EMIT changed();
}
}
void DolphinFontRequester::changeMode(int index)
{
setMode((index == CustomFont) ? CustomFont : SystemFont);
- emit changed();
+ Q_EMIT changed();
}
{
if (m_isDirty != isDirty) {
m_isDirty = isDirty;
- emit isDirtyChanged(isDirty);
+ Q_EMIT isDirtyChanged(isDirty);
}
}
void MountPointObserver::freeSpaceResult(KIO::Job* job, KIO::filesize_t size, KIO::filesize_t available)
{
if (!job->error()) {
- emit spaceInfoChanged(size, available);
+ Q_EMIT spaceInfoChanged(size, available);
} else {
- emit spaceInfoChanged(0, 0);
+ Q_EMIT spaceInfoChanged(0, 0);
}
}
m_dataSize = size;
m_dataAvailable = available;
- emit valuesChanged();
+ Q_EMIT valuesChanged();
}
}
m_trashDirLister->setDelayedMimeTypes(true);
auto trashDirContentChanged = [this]() {
bool isTrashEmpty = m_trashDirLister->items().isEmpty();
- emit emptinessChanged(isTrashEmpty);
+ Q_EMIT emptinessChanged(isTrashEmpty);
};
connect(m_trashDirLister, QOverload<>::of(&KCoreDirLister::completed), this, trashDirContentChanged);
connect(m_trashDirLister, &KDirLister::itemsDeleted, this, trashDirContentChanged);
if (active) {
m_container->setFocus();
- emit activated();
- emit writeStateChanged(m_isFolderWritable);
+ Q_EMIT activated();
+ Q_EMIT writeStateChanged(m_isFolderWritable);
}
}
const int oldZoomLevel = m_view->zoomLevel();
m_view->setPreviewsShown(show);
- emit previewsShownChanged(show);
+ Q_EMIT previewsShownChanged(show);
const int newZoomLevel = m_view->zoomLevel();
if (newZoomLevel != oldZoomLevel) {
- emit zoomLevelChanged(newZoomLevel, oldZoomLevel);
+ Q_EMIT zoomLevelChanged(newZoomLevel, oldZoomLevel);
}
}
props.setHiddenFilesShown(show);
m_model->setShowHiddenFiles(show);
- emit hiddenFilesShownChanged(show);
+ Q_EMIT hiddenFilesShownChanged(show);
}
bool DolphinView::hiddenFilesShown() const
m_container->controller()->model()->setGroupedSorting(grouped);
- emit groupedSortingChanged(grouped);
+ Q_EMIT groupedSortingChanged(grouped);
}
bool DolphinView::groupedSorting() const
m_view->setZoomLevel(level);
if (zoomLevel() != oldZoomLevel) {
hideToolTip();
- emit zoomLevelChanged(zoomLevel(), oldZoomLevel);
+ Q_EMIT zoomLevelChanged(zoomLevel(), oldZoomLevel);
}
}
m_visibleRoles = roles;
m_view->setVisibleRoles(roles);
- emit visibleRolesChanged(m_visibleRoles, previousRoles);
+ Q_EMIT visibleRolesChanged(m_visibleRoles, previousRoles);
}
QList<QByteArray> DolphinView::visibleRoles() const
const int newZoomLevel = m_view->zoomLevel();
if (newZoomLevel != oldZoomLevel) {
- emit zoomLevelChanged(newZoomLevel, oldZoomLevel);
+ Q_EMIT zoomLevelChanged(newZoomLevel, oldZoomLevel);
}
}
applyViewProperties();
loadDirectory(url);
- emit urlChanged(url);
+ Q_EMIT urlChanged(url);
}
void DolphinView::selectAll()
if (GeneralSettings::useTabForSwitchingSplitView()) {
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
if (keyEvent->key() == Qt::Key_Tab && keyEvent->modifiers() == Qt::NoModifier) {
- emit toggleActiveViewRequested();
+ Q_EMIT toggleActiveViewRequested();
return true;
}
}
const KFileItem item = m_model->fileItem(index);
if (!item.isNull()) {
- emit itemActivated(item);
+ Q_EMIT itemActivated(item);
}
}
const QUrl& url = openItemAsFolderUrl(item);
if (!url.isEmpty()) { // Open folders in new tabs
- emit tabRequested(url, DolphinTabWidget::AfterLastTab);
+ Q_EMIT tabRequested(url, DolphinTabWidget::AfterLastTab);
} else {
items.append(item);
}
}
if (items.count() == 1) {
- emit itemActivated(items.first());
+ Q_EMIT itemActivated(items.first());
} else if (items.count() > 1) {
- emit itemsActivated(items);
+ Q_EMIT itemsActivated(items);
}
}
const KFileItem& item = m_model->fileItem(index);
const QUrl& url = openItemAsFolderUrl(item);
if (!url.isEmpty()) {
- emit tabRequested(url, DolphinTabWidget::AfterCurrentTab);
+ Q_EMIT tabRequested(url, DolphinTabWidget::AfterCurrentTab);
} else if (isTabsForFilesEnabled()) {
- emit tabRequested(item.url(), DolphinTabWidget::AfterCurrentTab);
+ Q_EMIT tabRequested(item.url(), DolphinTabWidget::AfterCurrentTab);
}
}
}
const KFileItem item = m_model->fileItem(index);
- emit requestContextMenu(pos.toPoint(), item, url(), QList<QAction*>());
+ Q_EMIT requestContextMenu(pos.toPoint(), item, url(), QList<QAction*>());
}
void DolphinView::slotViewContextMenuRequested(const QPointF& pos)
{
- emit requestContextMenu(pos.toPoint(), KFileItem(), url(), QList<QAction*>());
+ Q_EMIT requestContextMenu(pos.toPoint(), KFileItem(), url(), QList<QAction*>());
}
void DolphinView::slotHeaderContextMenuRequested(const QPointF& pos)
#endif
}
- emit requestItemInfo(item);
+ Q_EMIT requestItemInfo(item);
}
void DolphinView::slotItemUnhovered(int index)
{
Q_UNUSED(index)
hideToolTip();
- emit requestItemInfo(KFileItem());
+ Q_EMIT requestItemInfo(KFileItem());
}
void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event)
hideToolTip();
if (buttons & Qt::BackButton) {
- emit goBackRequested();
+ Q_EMIT goBackRequested();
} else if (buttons & Qt::ForwardButton) {
- emit goForwardRequested();
+ Q_EMIT goForwardRequested();
}
}
void DolphinView::slotJobResult(KJob *job)
{
if (job->error()) {
- emit errorMessage(job->errorString());
+ Q_EMIT errorMessage(job->errorString());
}
if (!m_selectedUrls.isEmpty()) {
m_selectedUrls = KDirModel::simplifiedUrlList(m_selectedUrls);
void DolphinView::emitSelectionChangedSignal()
{
m_selectionChangedTimer->stop();
- emit selectionChanged(selectedItems());
+ Q_EMIT selectionChanged(selectedItems());
}
void DolphinView::updateSortRole(const QByteArray& role)
KItemModelBase* model = m_container->controller()->model();
model->setSortRole(role);
- emit sortRoleChanged(role);
+ Q_EMIT sortRoleChanged(role);
}
void DolphinView::updateSortOrder(Qt::SortOrder order)
m_model->setSortOrder(order);
- emit sortOrderChanged(order);
+ Q_EMIT sortOrderChanged(order);
}
void DolphinView::updateSortFoldersFirst(bool foldersFirst)
m_model->setSortDirectoriesFirst(foldersFirst);
- emit sortFoldersFirstChanged(foldersFirst);
+ Q_EMIT sortFoldersFirstChanged(foldersFirst);
}
QPair<bool, QString> DolphinView::pasteInfo() const
void DolphinView::slotDirectoryRedirection(const QUrl& oldUrl, const QUrl& newUrl)
{
if (oldUrl.matches(url(), QUrl::StripTrailingSlash)) {
- emit redirection(oldUrl, newUrl);
+ Q_EMIT redirection(oldUrl, newUrl);
m_url = newUrl; // #186947
}
}
void DolphinView::slotTrashFileFinished(KJob* job)
{
if (job->error() == 0) {
- emit operationCompletedMessage(i18nc("@info:status", "Trash operation completed."));
+ Q_EMIT operationCompletedMessage(i18nc("@info:status", "Trash operation completed."));
} else if (job->error() != KIO::ERR_USER_CANCELED) {
- emit errorMessage(job->errorString());
+ Q_EMIT errorMessage(job->errorString());
}
}
void DolphinView::slotDeleteFileFinished(KJob* job)
{
if (job->error() == 0) {
- emit operationCompletedMessage(i18nc("@info:status", "Delete operation completed."));
+ Q_EMIT operationCompletedMessage(i18nc("@info:status", "Delete operation completed."));
} else if (job->error() != KIO::ERR_USER_CANCELED) {
- emit errorMessage(job->errorString());
+ Q_EMIT errorMessage(job->errorString());
}
}
// in DolphinView::slotDirectoryLoadingCompleted()
if (m_isFolderWritable) {
m_isFolderWritable = false;
- emit writeStateChanged(m_isFolderWritable);
+ Q_EMIT writeStateChanged(m_isFolderWritable);
}
- emit directoryLoadingStarted();
+ Q_EMIT directoryLoadingStarted();
}
void DolphinView::slotDirectoryLoadingCompleted()
// because the view might not be in its final state yet.
QTimer::singleShot(0, this, &DolphinView::updateViewState);
- emit directoryLoadingCompleted();
+ Q_EMIT directoryLoadingCompleted();
updateWritableState();
}
ViewProperties props(viewPropertiesUrl());
props.setSortOrder(current);
- emit sortOrderChanged(current);
+ Q_EMIT sortOrderChanged(current);
}
void DolphinView::slotSortRoleChangedByHeader(const QByteArray& current, const QByteArray& previous)
ViewProperties props(viewPropertiesUrl());
props.setSortRole(current);
- emit sortRoleChanged(current);
+ Q_EMIT sortRoleChanged(current);
}
void DolphinView::slotVisibleRolesChangedByHeader(const QList<QByteArray>& current,
ViewProperties props(viewPropertiesUrl());
props.setVisibleRoles(m_visibleRoles);
- emit visibleRolesChanged(m_visibleRoles, previousVisibleRoles);
+ Q_EMIT visibleRolesChanged(m_visibleRoles, previousVisibleRoles);
}
void DolphinView::slotRoleEditingCanceled()
if (!url.isValid()) {
const QString location(url.toDisplayString(QUrl::PreferLocalFile));
if (location.isEmpty()) {
- emit errorMessage(i18nc("@info:status", "The location is empty."));
+ Q_EMIT errorMessage(i18nc("@info:status", "The location is empty."));
} else {
- emit errorMessage(i18nc("@info:status", "The location '%1' is invalid.", location));
+ Q_EMIT errorMessage(i18nc("@info:status", "The location '%1' is invalid.", location));
}
return;
}
const int oldZoomLevel = m_view->zoomLevel();
applyModeToView();
- emit modeChanged(m_mode, previousMode);
+ Q_EMIT modeChanged(m_mode, previousMode);
if (m_view->zoomLevel() != oldZoomLevel) {
- emit zoomLevelChanged(m_view->zoomLevel(), oldZoomLevel);
+ Q_EMIT zoomLevelChanged(m_view->zoomLevel(), oldZoomLevel);
}
}
const bool hiddenFilesShown = props.hiddenFilesShown();
if (hiddenFilesShown != m_model->showHiddenFiles()) {
m_model->setShowHiddenFiles(hiddenFilesShown);
- emit hiddenFilesShownChanged(hiddenFilesShown);
+ Q_EMIT hiddenFilesShownChanged(hiddenFilesShown);
}
const bool groupedSorting = props.groupedSorting();
if (groupedSorting != m_model->groupedSorting()) {
m_model->setGroupedSorting(groupedSorting);
- emit groupedSortingChanged(groupedSorting);
+ Q_EMIT groupedSortingChanged(groupedSorting);
}
const QByteArray sortRole = props.sortRole();
if (sortRole != m_model->sortRole()) {
m_model->setSortRole(sortRole);
- emit sortRoleChanged(sortRole);
+ Q_EMIT sortRoleChanged(sortRole);
}
const Qt::SortOrder sortOrder = props.sortOrder();
if (sortOrder != m_model->sortOrder()) {
m_model->setSortOrder(sortOrder);
- emit sortOrderChanged(sortOrder);
+ Q_EMIT sortOrderChanged(sortOrder);
}
const bool sortFoldersFirst = props.sortFoldersFirst();
if (sortFoldersFirst != m_model->sortDirectoriesFirst()) {
m_model->setSortDirectoriesFirst(sortFoldersFirst);
- emit sortFoldersFirstChanged(sortFoldersFirst);
+ Q_EMIT sortFoldersFirstChanged(sortFoldersFirst);
}
const QList<QByteArray> visibleRoles = props.visibleRoles();
const QList<QByteArray> previousVisibleRoles = m_visibleRoles;
m_visibleRoles = visibleRoles;
m_view->setVisibleRoles(visibleRoles);
- emit visibleRolesChanged(m_visibleRoles, previousVisibleRoles);
+ Q_EMIT visibleRolesChanged(m_visibleRoles, previousVisibleRoles);
}
const bool previewsShown = props.previewsShown();
const int oldZoomLevel = zoomLevel();
m_view->setPreviewsShown(previewsShown);
- emit previewsShownChanged(previewsShown);
+ Q_EMIT previewsShownChanged(previewsShown);
// Changing the preview-state might result in a changed zoom-level
if (oldZoomLevel != zoomLevel()) {
- emit zoomLevelChanged(zoomLevel(), oldZoomLevel);
+ Q_EMIT zoomLevelChanged(zoomLevel(), oldZoomLevel);
}
}
m_isFolderWritable = capabilities.supportsWriting();
if (m_isFolderWritable != wasFolderWritable) {
- emit writeStateChanged(m_isFolderWritable);
+ Q_EMIT writeStateChanged(m_isFolderWritable);
}
}
void DolphinView::slotSwipeUp()
{
- emit goUpRequested();
+ Q_EMIT goUpRequested();
}
void DolphinViewActionHandler::slotRename()
{
- emit actionBeingHandled();
+ Q_EMIT actionBeingHandled();
m_currentView->renameSelectedItems();
}
void DolphinViewActionHandler::slotTrashActivated()
{
- emit actionBeingHandled();
+ Q_EMIT actionBeingHandled();
m_currentView->trashSelectedItems();
}
void DolphinViewActionHandler::slotDeleteItems()
{
- emit actionBeingHandled();
+ Q_EMIT actionBeingHandled();
m_currentView->deleteSelectedItems();
}
void DolphinViewActionHandler::togglePreview(bool show)
{
- emit actionBeingHandled();
+ Q_EMIT actionBeingHandled();
m_currentView->setPreviewsShown(show);
}
void DolphinViewActionHandler::toggleVisibleRole(QAction* action)
{
- emit actionBeingHandled();
+ Q_EMIT actionBeingHandled();
const QByteArray toggledRole = action->data().toByteArray();
void DolphinViewActionHandler::toggleShowHiddenFiles(bool show)
{
- emit actionBeingHandled();
+ Q_EMIT actionBeingHandled();
m_currentView->setHiddenFilesShown(show);
}
void DolphinViewActionHandler::slotAdjustViewProperties()
{
- emit actionBeingHandled();
+ Q_EMIT actionBeingHandled();
QPointer<ViewPropertiesDialog> dialog = new ViewPropertiesDialog(m_currentView);
dialog->exec();
delete dialog;
void DolphinViewActionHandler::slotDuplicate()
{
- emit actionBeingHandled();
+ Q_EMIT actionBeingHandled();
m_currentView->duplicateSelectedItems();
}
// Using an empty message results in clearing the previously shown information message and showing
// the default status bar information. This is useful as the user already gets feedback that the
// operation has been completed because of the icon emblems.
- emit operationCompletedMessage(QString());
+ Q_EMIT operationCompletedMessage(QString());
}
if (m_pendingItemStatesUpdate) {
if (!itemStates.isEmpty()) {
if (!m_silentUpdate) {
- emit infoMessage(i18nc("@info:status", "Updating version information..."));
+ Q_EMIT infoMessage(i18nc("@info:status", "Updating version information..."));
}
m_updateItemStatesThread = new UpdateItemStatesThread(m_plugin, itemStates);
connect(m_updateItemStatesThread, &UpdateItemStatesThread::finished,
void ViewModeController::indicateActivationChange(bool active)
{
- emit activationChanged(active);
+ Q_EMIT activationChanged(active);
}
void ViewModeController::setNameFilter(const QString& nameFilter)
{
if (nameFilter != m_nameFilter) {
m_nameFilter = nameFilter;
- emit nameFilterChanged(nameFilter);
+ Q_EMIT nameFilterChanged(nameFilter);
}
}
Q_ASSERT(level <= ZoomLevelInfo::maximumLevel());
if (level != m_zoomLevel) {
m_zoomLevel = level;
- emit zoomLevelChanged(m_zoomLevel);
+ Q_EMIT zoomLevelChanged(m_zoomLevel);
}
}
{
if (m_url != url) {
m_url = url;
- emit cancelPreviews();
- emit urlChanged(url);
+ Q_EMIT cancelPreviews();
+ Q_EMIT urlChanged(url);
}
}