Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinpart.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
49 | 49 | | |||
50 | #include <QActionGroup> | 50 | #include <QActionGroup> | ||
51 | #include <QApplication> | 51 | #include <QApplication> | ||
52 | #include <QClipboard> | 52 | #include <QClipboard> | ||
53 | #include <QDir> | 53 | #include <QDir> | ||
54 | #include <QInputDialog> | 54 | #include <QInputDialog> | ||
55 | #include <QKeyEvent> | 55 | #include <QKeyEvent> | ||
56 | #include <QMenu> | 56 | #include <QMenu> | ||
57 | #include <QRegularExpression> | ||||
57 | #include <QStandardPaths> | 58 | #include <QStandardPaths> | ||
58 | #include <QTextDocument> | 59 | #include <QTextDocument> | ||
59 | 60 | | |||
60 | K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin<DolphinPart>();) | 61 | K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin<DolphinPart>();) | ||
61 | 62 | | |||
62 | DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args) | 63 | DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantList& args) | ||
63 | : KParts::ReadOnlyPart(parent) | 64 | : KParts::ReadOnlyPart(parent) | ||
64 | ,m_openTerminalAction(nullptr) | 65 | ,m_openTerminalAction(nullptr) | ||
▲ Show 20 Lines • Show All 437 Lines • ▼ Show 20 Line(s) | |||||
502 | } | 503 | } | ||
503 | 504 | | |||
504 | void DolphinPart::openSelectionDialog(const QString& title, const QString& text, bool selectItems) | 505 | void DolphinPart::openSelectionDialog(const QString& title, const QString& text, bool selectItems) | ||
505 | { | 506 | { | ||
506 | bool okClicked; | 507 | bool okClicked; | ||
507 | const QString pattern = QInputDialog::getText(m_view, title, text, QLineEdit::Normal, QStringLiteral("*"), &okClicked); | 508 | const QString pattern = QInputDialog::getText(m_view, title, text, QLineEdit::Normal, QStringLiteral("*"), &okClicked); | ||
508 | 509 | | |||
509 | if (okClicked && !pattern.isEmpty()) { | 510 | if (okClicked && !pattern.isEmpty()) { | ||
510 | QRegExp patternRegExp(pattern, Qt::CaseSensitive, QRegExp::Wildcard); | 511 | const QRegularExpression patternRegExp(QRegularExpression::wildcardToRegularExpression(pattern)); | ||
meven: const | |||||
511 | m_view->selectItems(patternRegExp, selectItems); | 512 | m_view->selectItems(patternRegExp, selectItems); | ||
elvisangelaccio: Please use a single line. | |||||
512 | } | 513 | } | ||
513 | } | 514 | } | ||
514 | 515 | | |||
515 | void DolphinPart::setCurrentViewMode(const QString& viewModeName) | 516 | void DolphinPart::setCurrentViewMode(const QString& viewModeName) | ||
516 | { | 517 | { | ||
517 | QAction* action = actionCollection()->action(viewModeName); | 518 | QAction* action = actionCollection()->action(viewModeName); | ||
518 | Q_ASSERT(action); | 519 | Q_ASSERT(action); | ||
519 | action->trigger(); | 520 | action->trigger(); | ||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |
const