forked from qt-creator/qt-creator
Reduce usage of qApp in favor of static function calls
Q*Application classes have unusually many static functions. In many cases in our code, these functions are unnecessarily called as instance functions, using the qApp helper. This patch replaces many occurencies of qApp with the according Q*Application classname. Change-Id: I6099a419fa7bf969891269c37ed7a9e817ef5124 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -142,7 +142,7 @@ QPixmap DetailsWidget::createBackground(const QSize &size, int topHeight, QWidge
|
|||||||
QRect topRect(0, 0, size.width(), topHeight);
|
QRect topRect(0, 0, size.width(), topHeight);
|
||||||
QRect fullRect(0, 0, size.width(), size.height());
|
QRect fullRect(0, 0, size.width(), size.height());
|
||||||
if (HostOsInfo::isMacHost())
|
if (HostOsInfo::isMacHost())
|
||||||
p.fillRect(fullRect, qApp->palette().window().color());
|
p.fillRect(fullRect, QApplication::palette().window().color());
|
||||||
else
|
else
|
||||||
p.fillRect(fullRect, creatorTheme()->color(Theme::DetailsWidgetBackgroundColor));
|
p.fillRect(fullRect, creatorTheme()->color(Theme::DetailsWidgetBackgroundColor));
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Utils {
|
|||||||
QAction *execMenuAtWidget(QMenu *menu, QWidget *widget)
|
QAction *execMenuAtWidget(QMenu *menu, QWidget *widget)
|
||||||
{
|
{
|
||||||
QPoint p;
|
QPoint p;
|
||||||
QRect screen = qApp->desktop()->availableGeometry(widget);
|
QRect screen = QApplication::desktop()->availableGeometry(widget);
|
||||||
QSize sh = menu->sizeHint();
|
QSize sh = menu->sizeHint();
|
||||||
QRect rect = widget->rect();
|
QRect rect = widget->rect();
|
||||||
if (widget->isRightToLeft()) {
|
if (widget->isRightToLeft()) {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ qreal StyleHelper::sidebarFontSize()
|
|||||||
|
|
||||||
QColor StyleHelper::notTooBrightHighlightColor()
|
QColor StyleHelper::notTooBrightHighlightColor()
|
||||||
{
|
{
|
||||||
QColor highlightColor = qApp->palette().highlight().color();
|
QColor highlightColor = QApplication::palette().highlight().color();
|
||||||
if (0.5 * highlightColor.saturationF() + 0.75 - highlightColor.valueF() < 0)
|
if (0.5 * highlightColor.saturationF() + 0.75 - highlightColor.valueF() < 0)
|
||||||
highlightColor.setHsvF(highlightColor.hsvHueF(), 0.1 + highlightColor.saturationF() * 2.0, highlightColor.valueF());
|
highlightColor.setHsvF(highlightColor.hsvHueF(), 0.1 + highlightColor.saturationF() * 2.0, highlightColor.valueF());
|
||||||
return highlightColor;
|
return highlightColor;
|
||||||
@@ -101,7 +101,6 @@ QPalette StyleHelper::sidebarFontPalette(const QPalette &original)
|
|||||||
|
|
||||||
QColor StyleHelper::panelTextColor(bool lightColored)
|
QColor StyleHelper::panelTextColor(bool lightColored)
|
||||||
{
|
{
|
||||||
//qApp->palette().highlightedText().color();
|
|
||||||
if (!lightColored)
|
if (!lightColored)
|
||||||
return Qt::white;
|
return Qt::white;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QApplication>
|
#include <QGuiApplication>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
@@ -296,7 +296,7 @@ void ToolTip::placeTip(const QPoint &pos, QWidget *w)
|
|||||||
bool ToolTip::eventFilter(QObject *o, QEvent *event)
|
bool ToolTip::eventFilter(QObject *o, QEvent *event)
|
||||||
{
|
{
|
||||||
if (m_tip && event->type() == QEvent::ApplicationStateChange
|
if (m_tip && event->type() == QEvent::ApplicationStateChange
|
||||||
&& qApp->applicationState() != Qt::ApplicationActive) {
|
&& QGuiApplication::applicationState() != Qt::ApplicationActive) {
|
||||||
hideTipImmediately();
|
hideTipImmediately();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,7 +316,7 @@ bool ToolTip::eventFilter(QObject *o, QEvent *event)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QEvent::Leave:
|
case QEvent::Leave:
|
||||||
if (o == m_tip && !m_tip->isAncestorOf(qApp->focusWidget()))
|
if (o == m_tip && !m_tip->isAncestorOf(QApplication::focusWidget()))
|
||||||
hideTipWithDelay();
|
hideTipWithDelay();
|
||||||
break;
|
break;
|
||||||
case QEvent::Enter:
|
case QEvent::Enter:
|
||||||
|
|||||||
@@ -434,7 +434,7 @@ BinEditorFactory::BinEditorFactory(BinEditorPlugin *owner) :
|
|||||||
m_owner(owner)
|
m_owner(owner)
|
||||||
{
|
{
|
||||||
setId(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
|
setId(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
|
||||||
setDisplayName(qApp->translate("OpenWith::Editors", Constants::C_BINEDITOR_DISPLAY_NAME));
|
setDisplayName(QCoreApplication::translate("OpenWith::Editors", Constants::C_BINEDITOR_DISPLAY_NAME));
|
||||||
addMimeType(Constants::C_BINEDITOR_MIMETYPE);
|
addMimeType(Constants::C_BINEDITOR_MIMETYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ CMakeListsNode::CMakeListsNode(const Utils::FileName &cmakeListPath) :
|
|||||||
static QIcon folderIcon;
|
static QIcon folderIcon;
|
||||||
if (folderIcon.isNull()) {
|
if (folderIcon.isNull()) {
|
||||||
const QIcon overlayIcon(Constants::FILEOVERLAY_CMAKE);
|
const QIcon overlayIcon(Constants::FILEOVERLAY_CMAKE);
|
||||||
QPixmap dirPixmap = qApp->style()->standardIcon(QStyle::SP_DirIcon).pixmap(QSize(16, 16));
|
QPixmap dirPixmap = QApplication::style()->standardIcon(QStyle::SP_DirIcon).pixmap(QSize(16, 16));
|
||||||
|
|
||||||
folderIcon.addPixmap(Core::FileIconProvider::overlayIcon(dirPixmap, overlayIcon));
|
folderIcon.addPixmap(Core::FileIconProvider::overlayIcon(dirPixmap, overlayIcon));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -505,7 +505,7 @@ void SettingsDialog::createGui()
|
|||||||
m_headerLabel->setFont(headerLabelFont);
|
m_headerLabel->setFont(headerLabelFont);
|
||||||
|
|
||||||
QHBoxLayout *headerHLayout = new QHBoxLayout;
|
QHBoxLayout *headerHLayout = new QHBoxLayout;
|
||||||
const int leftMargin = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin);
|
const int leftMargin = QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin);
|
||||||
headerHLayout->addSpacerItem(new QSpacerItem(leftMargin, 0, QSizePolicy::Fixed, QSizePolicy::Ignored));
|
headerHLayout->addSpacerItem(new QSpacerItem(leftMargin, 0, QSizePolicy::Fixed, QSizePolicy::Ignored));
|
||||||
headerHLayout->addWidget(m_headerLabel);
|
headerHLayout->addWidget(m_headerLabel);
|
||||||
|
|
||||||
|
|||||||
@@ -200,8 +200,8 @@ void ShortcutButton::handleToggleChange(bool toogleState)
|
|||||||
updateText();
|
updateText();
|
||||||
m_keyNum = m_key[0] = m_key[1] = m_key[2] = m_key[3] = 0;
|
m_keyNum = m_key[0] = m_key[1] = m_key[2] = m_key[3] = 0;
|
||||||
if (toogleState) {
|
if (toogleState) {
|
||||||
if (qApp->focusWidget())
|
if (QApplication::focusWidget())
|
||||||
qApp->focusWidget()->clearFocus(); // funny things happen otherwise
|
QApplication::focusWidget()->clearFocus(); // funny things happen otherwise
|
||||||
qApp->installEventFilter(this);
|
qApp->installEventFilter(this);
|
||||||
} else {
|
} else {
|
||||||
qApp->removeEventFilter(this);
|
qApp->removeEventFilter(this);
|
||||||
|
|||||||
@@ -822,10 +822,10 @@ void EditorManagerPrivate::doEscapeKeyFocusMoveMagic()
|
|||||||
// otherwise (i.e. mode is edit mode)
|
// otherwise (i.e. mode is edit mode)
|
||||||
// hide extra views (find, help, output)
|
// hide extra views (find, help, output)
|
||||||
|
|
||||||
QWidget *activeWindow = qApp->activeWindow();
|
QWidget *activeWindow = QApplication::activeWindow();
|
||||||
if (!activeWindow)
|
if (!activeWindow)
|
||||||
return;
|
return;
|
||||||
QWidget *focus = qApp->focusWidget();
|
QWidget *focus = QApplication::focusWidget();
|
||||||
EditorView *editorView = currentEditorView();
|
EditorView *editorView = currentEditorView();
|
||||||
bool editorViewActive = (focus && focus == editorView->focusWidget());
|
bool editorViewActive = (focus && focus == editorView->focusWidget());
|
||||||
bool editorViewVisible = editorView->isVisible();
|
bool editorViewVisible = editorView->isVisible();
|
||||||
@@ -886,7 +886,7 @@ void EditorManagerPrivate::showPopupOrSelectDocument()
|
|||||||
if (QApplication::keyboardModifiers() == Qt::NoModifier) {
|
if (QApplication::keyboardModifiers() == Qt::NoModifier) {
|
||||||
windowPopup()->selectAndHide();
|
windowPopup()->selectAndHide();
|
||||||
} else {
|
} else {
|
||||||
QWidget *activeWindow = qApp->activeWindow();
|
QWidget *activeWindow = QApplication::activeWindow();
|
||||||
// decide where to show the popup
|
// decide where to show the popup
|
||||||
// if the active window has editors, we want that editor area as a reference
|
// if the active window has editors, we want that editor area as a reference
|
||||||
// TODO: this does not work correctly with multiple editor areas in the same window
|
// TODO: this does not work correctly with multiple editor areas in the same window
|
||||||
@@ -1388,7 +1388,7 @@ bool EditorManagerPrivate::closeEditors(const QList<IEditor*> &editors, CloseFla
|
|||||||
|
|
||||||
removeEditor(editor, flag != CloseFlag::Suspend);
|
removeEditor(editor, flag != CloseFlag::Suspend);
|
||||||
if (EditorView *view = viewForEditor(editor)) {
|
if (EditorView *view = viewForEditor(editor)) {
|
||||||
if (qApp->focusWidget() && qApp->focusWidget() == editor->widget()->focusWidget())
|
if (QApplication::focusWidget() && QApplication::focusWidget() == editor->widget()->focusWidget())
|
||||||
focusView = view;
|
focusView = view;
|
||||||
if (editor == view->currentEditor())
|
if (editor == view->currentEditor())
|
||||||
closedViews += view;
|
closedViews += view;
|
||||||
@@ -1930,7 +1930,7 @@ void EditorManagerPrivate::handleDocumentStateChange()
|
|||||||
|
|
||||||
void EditorManagerPrivate::editorAreaDestroyed(QObject *area)
|
void EditorManagerPrivate::editorAreaDestroyed(QObject *area)
|
||||||
{
|
{
|
||||||
QWidget *activeWin = qApp->activeWindow();
|
QWidget *activeWin = QApplication::activeWindow();
|
||||||
EditorArea *newActiveArea = 0;
|
EditorArea *newActiveArea = 0;
|
||||||
for (int i = 0; i < d->m_editorAreas.size(); ++i) {
|
for (int i = 0; i < d->m_editorAreas.size(); ++i) {
|
||||||
EditorArea *r = d->m_editorAreas.at(i);
|
EditorArea *r = d->m_editorAreas.at(i);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class FileIconProviderImplementation : public QFileIconProvider
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FileIconProviderImplementation()
|
FileIconProviderImplementation()
|
||||||
: m_unknownFileIcon(qApp->style()->standardIcon(QStyle::SP_FileIcon))
|
: m_unknownFileIcon(QApplication::style()->standardIcon(QStyle::SP_FileIcon))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QIcon icon(const QFileInfo &info) const override;
|
QIcon icon(const QFileInfo &info) const override;
|
||||||
@@ -184,7 +184,7 @@ QPixmap overlayIcon(const QPixmap &baseIcon, const QIcon &overlayIcon)
|
|||||||
*/
|
*/
|
||||||
QPixmap overlayIcon(QStyle::StandardPixmap baseIcon, const QIcon &overlay, const QSize &size)
|
QPixmap overlayIcon(QStyle::StandardPixmap baseIcon, const QIcon &overlay, const QSize &size)
|
||||||
{
|
{
|
||||||
return overlayIcon(qApp->style()->standardIcon(baseIcon).pixmap(size), overlay);
|
return overlayIcon(QApplication::style()->standardIcon(baseIcon).pixmap(size), overlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -742,7 +742,7 @@ FindToolBarPlaceHolder *FindToolBar::findToolBarPlaceHolder() const
|
|||||||
|
|
||||||
bool FindToolBar::toolBarHasFocus() const
|
bool FindToolBar::toolBarHasFocus() const
|
||||||
{
|
{
|
||||||
return qApp->focusWidget() == focusWidget();
|
return QApplication::focusWidget() == focusWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FindToolBar::canShowAllControls(bool replaceIsVisible) const
|
bool FindToolBar::canShowAllControls(bool replaceIsVisible) const
|
||||||
|
|||||||
@@ -916,7 +916,7 @@ void MainWindow::updateFocusWidget(QWidget *old, QWidget *now)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QList<IContext *> newContext;
|
QList<IContext *> newContext;
|
||||||
if (QWidget *p = qApp->focusWidget()) {
|
if (QWidget *p = QApplication::focusWidget()) {
|
||||||
IContext *context = nullptr;
|
IContext *context = nullptr;
|
||||||
while (p) {
|
while (p) {
|
||||||
context = m_contextWidgets.value(p);
|
context = m_contextWidgets.value(p);
|
||||||
@@ -927,7 +927,7 @@ void MainWindow::updateFocusWidget(QWidget *old, QWidget *now)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ignore toplevels that define no context, like popups without parent
|
// ignore toplevels that define no context, like popups without parent
|
||||||
if (!newContext.isEmpty() || qApp->focusWidget() == focusWidget())
|
if (!newContext.isEmpty() || QApplication::focusWidget() == focusWidget())
|
||||||
updateContextObject(newContext);
|
updateContextObject(newContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ VariableChooserPrivate::VariableChooserPrivate(VariableChooser *parent)
|
|||||||
this, &VariableChooserPrivate::handleItemActivated);
|
this, &VariableChooserPrivate::handleItemActivated);
|
||||||
connect(qobject_cast<QApplication *>(qApp), &QApplication::focusChanged,
|
connect(qobject_cast<QApplication *>(qApp), &QApplication::focusChanged,
|
||||||
this, &VariableChooserPrivate::updateCurrentEditor);
|
this, &VariableChooserPrivate::updateCurrentEditor);
|
||||||
updateCurrentEditor(0, qApp->focusWidget());
|
updateCurrentEditor(0, QApplication::focusWidget());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VariableGroupItem::populateGroup(MacroExpander *expander)
|
void VariableGroupItem::populateGroup(MacroExpander *expander)
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ void CodepasterPlugin::post(PasteSources pasteSources)
|
|||||||
textFromCurrentEditor(&data, &mimeType);
|
textFromCurrentEditor(&data, &mimeType);
|
||||||
if (data.isEmpty() && (pasteSources & PasteClipboard)) {
|
if (data.isEmpty() && (pasteSources & PasteClipboard)) {
|
||||||
QString subType = QStringLiteral("plain");
|
QString subType = QStringLiteral("plain");
|
||||||
data = qApp->clipboard()->text(subType, QClipboard::Clipboard);
|
data = QGuiApplication::clipboard()->text(subType, QClipboard::Clipboard);
|
||||||
}
|
}
|
||||||
post(data, mimeType);
|
post(data, mimeType);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,13 +63,13 @@ public:
|
|||||||
? file.open(stdin, QIODevice::ReadOnly) : file.open(QIODevice::ReadOnly);
|
? file.open(stdin, QIODevice::ReadOnly) : file.open(QIODevice::ReadOnly);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
std::cerr << "Error: Failed to open file to paste from." << std::endl;
|
std::cerr << "Error: Failed to open file to paste from." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const QString content = QString::fromLocal8Bit(file.readAll());
|
const QString content = QString::fromLocal8Bit(file.readAll());
|
||||||
if (content.isEmpty()) {
|
if (content.isEmpty()) {
|
||||||
std::cerr << "Empty input, aborting." << std::endl;
|
std::cerr << "Empty input, aborting." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
connect(m_protocol.data(), &Protocol::pasteDone, this, &PasteReceiver::handlePasteDone);
|
connect(m_protocol.data(), &Protocol::pasteDone, this, &PasteReceiver::handlePasteDone);
|
||||||
@@ -80,7 +80,7 @@ private:
|
|||||||
void handlePasteDone(const QString &link)
|
void handlePasteDone(const QString &link)
|
||||||
{
|
{
|
||||||
std::cout << qPrintable(link) << std::endl;
|
std::cout << qPrintable(link) << std::endl;
|
||||||
qApp->quit();
|
QCoreApplication::quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString m_filePath;
|
const QString m_filePath;
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public:
|
|||||||
CppEditorFactory()
|
CppEditorFactory()
|
||||||
{
|
{
|
||||||
setId(Constants::CPPEDITOR_ID);
|
setId(Constants::CPPEDITOR_ID);
|
||||||
setDisplayName(qApp->translate("OpenWith::Editors", Constants::CPPEDITOR_DISPLAY_NAME));
|
setDisplayName(QCoreApplication::translate("OpenWith::Editors", Constants::CPPEDITOR_DISPLAY_NAME));
|
||||||
addMimeType(CppTools::Constants::C_SOURCE_MIMETYPE);
|
addMimeType(CppTools::Constants::C_SOURCE_MIMETYPE);
|
||||||
addMimeType(CppTools::Constants::C_HEADER_MIMETYPE);
|
addMimeType(CppTools::Constants::C_HEADER_MIMETYPE);
|
||||||
addMimeType(CppTools::Constants::CPP_SOURCE_MIMETYPE);
|
addMimeType(CppTools::Constants::CPP_SOURCE_MIMETYPE);
|
||||||
|
|||||||
@@ -1269,7 +1269,7 @@ static QString variableToolTip(const QString &name, const QString &type, quint64
|
|||||||
|
|
||||||
void WatchModel::grabWidget()
|
void WatchModel::grabWidget()
|
||||||
{
|
{
|
||||||
qApp->setOverrideCursor(Qt::CrossCursor);
|
QGuiApplication::setOverrideCursor(Qt::CrossCursor);
|
||||||
m_grabWidgetTimerId = startTimer(30);
|
m_grabWidgetTimerId = startTimer(30);
|
||||||
ICore::mainWindow()->grabMouse();
|
ICore::mainWindow()->grabMouse();
|
||||||
}
|
}
|
||||||
@@ -1302,7 +1302,7 @@ void WatchModel::timerEvent(QTimerEvent *event)
|
|||||||
void WatchModel::ungrabWidget()
|
void WatchModel::ungrabWidget()
|
||||||
{
|
{
|
||||||
ICore::mainWindow()->releaseMouse();
|
ICore::mainWindow()->releaseMouse();
|
||||||
qApp->restoreOverrideCursor();
|
QGuiApplication::restoreOverrideCursor();
|
||||||
killTimer(m_grabWidgetTimerId);
|
killTimer(m_grabWidgetTimerId);
|
||||||
m_grabWidgetTimerId = -1;
|
m_grabWidgetTimerId = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Internal {
|
|||||||
FormEditorFactory::FormEditorFactory()
|
FormEditorFactory::FormEditorFactory()
|
||||||
{
|
{
|
||||||
setId(K_DESIGNER_XML_EDITOR_ID);
|
setId(K_DESIGNER_XML_EDITOR_ID);
|
||||||
setDisplayName(qApp->translate("Designer", C_DESIGNER_XML_DISPLAY_NAME));
|
setDisplayName(QCoreApplication::translate("Designer", C_DESIGNER_XML_DISPLAY_NAME));
|
||||||
addMimeType(FORM_MIMETYPE);
|
addMimeType(FORM_MIMETYPE);
|
||||||
|
|
||||||
FileIconProvider::registerIconOverlayForSuffix(ProjectExplorer::Constants::FILEOVERLAY_UI, "ui");
|
FileIconProvider::registerIconOverlayForSuffix(ProjectExplorer::Constants::FILEOVERLAY_UI, "ui");
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
#include <utils/mimetypes/mimedatabase.h>
|
#include <utils/mimetypes/mimedatabase.h>
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
@@ -108,7 +108,7 @@ bool FormEditorPlugin::initialize(const QStringList &arguments, QString *error)
|
|||||||
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||||
const QString &trFile = QLatin1String("designer_") + locale;
|
const QString &trFile = QLatin1String("designer_") + locale;
|
||||||
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
||||||
qApp->installTranslator(qtr);
|
QCoreApplication::installTranslator(qtr);
|
||||||
}
|
}
|
||||||
error->clear();
|
error->clear();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ DiffEditorFactory::DiffEditorFactory(QObject *parent)
|
|||||||
: IEditorFactory(parent)
|
: IEditorFactory(parent)
|
||||||
{
|
{
|
||||||
setId(Constants::DIFF_EDITOR_ID);
|
setId(Constants::DIFF_EDITOR_ID);
|
||||||
setDisplayName(qApp->translate("DiffEditorFactory", Constants::DIFF_EDITOR_DISPLAY_NAME));
|
setDisplayName(QCoreApplication::translate("DiffEditorFactory", Constants::DIFF_EDITOR_DISPLAY_NAME));
|
||||||
addMimeType(Constants::DIFF_EDITOR_MIMETYPE);
|
addMimeType(Constants::DIFF_EDITOR_MIMETYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ GenericProjectWizard::GenericProjectWizard()
|
|||||||
QPixmap icon(22, 22);
|
QPixmap icon(22, 22);
|
||||||
icon.fill(Qt::transparent);
|
icon.fill(Qt::transparent);
|
||||||
QPainter p(&icon);
|
QPainter p(&icon);
|
||||||
p.drawPixmap(3, 3, 16, 16, qApp->style()->standardIcon(QStyle::SP_DirIcon).pixmap(16));
|
p.drawPixmap(3, 3, 16, 16, QApplication::style()->standardIcon(QStyle::SP_DirIcon).pixmap(16));
|
||||||
setIcon(icon);
|
setIcon(icon);
|
||||||
}
|
}
|
||||||
setDisplayName(tr("Import Existing Project"));
|
setDisplayName(tr("Import Existing Project"));
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ AssistInterface *GlslEditorWidget::createAssistInterface(
|
|||||||
GlslEditorFactory::GlslEditorFactory()
|
GlslEditorFactory::GlslEditorFactory()
|
||||||
{
|
{
|
||||||
setId(Constants::C_GLSLEDITOR_ID);
|
setId(Constants::C_GLSLEDITOR_ID);
|
||||||
setDisplayName(qApp->translate("OpenWith::Editors", Constants::C_GLSLEDITOR_DISPLAY_NAME));
|
setDisplayName(QCoreApplication::translate("OpenWith::Editors", Constants::C_GLSLEDITOR_DISPLAY_NAME));
|
||||||
addMimeType(Constants::GLSL_MIMETYPE);
|
addMimeType(Constants::GLSL_MIMETYPE);
|
||||||
addMimeType(Constants::GLSL_MIMETYPE_VERT);
|
addMimeType(Constants::GLSL_MIMETYPE_VERT);
|
||||||
addMimeType(Constants::GLSL_MIMETYPE_FRAG);
|
addMimeType(Constants::GLSL_MIMETYPE_FRAG);
|
||||||
|
|||||||
@@ -136,9 +136,9 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
|||||||
const QString &trFile = QLatin1String("assistant_") + locale;
|
const QString &trFile = QLatin1String("assistant_") + locale;
|
||||||
const QString &helpTrFile = QLatin1String("qt_help_") + locale;
|
const QString &helpTrFile = QLatin1String("qt_help_") + locale;
|
||||||
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
if (qtr->load(trFile, qtTrPath) || qtr->load(trFile, creatorTrPath))
|
||||||
qApp->installTranslator(qtr);
|
QCoreApplication::installTranslator(qtr);
|
||||||
if (qhelptr->load(helpTrFile, qtTrPath) || qhelptr->load(helpTrFile, creatorTrPath))
|
if (qhelptr->load(helpTrFile, qtTrPath) || qhelptr->load(helpTrFile, creatorTrPath))
|
||||||
qApp->installTranslator(qhelptr);
|
QCoreApplication::installTranslator(qhelptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_helpManager = new LocalHelpManager(this);
|
m_helpManager = new LocalHelpManager(this);
|
||||||
@@ -448,9 +448,9 @@ void HelpPlugin::modeChanged(Core::Id mode, Core::Id old)
|
|||||||
{
|
{
|
||||||
Q_UNUSED(old)
|
Q_UNUSED(old)
|
||||||
if (mode == m_mode->id()) {
|
if (mode == m_mode->id()) {
|
||||||
qApp->setOverrideCursor(Qt::WaitCursor);
|
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
doSetupIfNeeded();
|
doSetupIfNeeded();
|
||||||
qApp->restoreOverrideCursor();
|
QGuiApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QGuiApplication>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
|
||||||
@@ -156,12 +156,12 @@ void HelpViewer::home()
|
|||||||
|
|
||||||
void HelpViewer::slotLoadStarted()
|
void HelpViewer::slotLoadStarted()
|
||||||
{
|
{
|
||||||
qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
|
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||||
}
|
}
|
||||||
|
|
||||||
void HelpViewer::slotLoadFinished()
|
void HelpViewer::slotLoadFinished()
|
||||||
{
|
{
|
||||||
qApp->restoreOverrideCursor();
|
QGuiApplication::restoreOverrideCursor();
|
||||||
emit sourceChanged(source());
|
emit sourceChanged(source());
|
||||||
emit loadFinished();
|
emit loadFinished();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,13 +184,13 @@ void SearchWidget::search() const
|
|||||||
|
|
||||||
void SearchWidget::searchingStarted()
|
void SearchWidget::searchingStarted()
|
||||||
{
|
{
|
||||||
qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
|
QGuiApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchWidget::searchingFinished(int hits)
|
void SearchWidget::searchingFinished(int hits)
|
||||||
{
|
{
|
||||||
Q_UNUSED(hits)
|
Q_UNUSED(hits)
|
||||||
qApp->restoreOverrideCursor();
|
QGuiApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchWidget::indexingStarted()
|
void SearchWidget::indexingStarted()
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ ImageViewerFactory::ImageViewerFactory(QObject *parent) :
|
|||||||
Core::IEditorFactory(parent)
|
Core::IEditorFactory(parent)
|
||||||
{
|
{
|
||||||
setId(Constants::IMAGEVIEWER_ID);
|
setId(Constants::IMAGEVIEWER_ID);
|
||||||
setDisplayName(qApp->translate("OpenWith::Editors", Constants::IMAGEVIEWER_DISPLAY_NAME));
|
setDisplayName(QCoreApplication::translate("OpenWith::Editors", Constants::IMAGEVIEWER_DISPLAY_NAME));
|
||||||
|
|
||||||
const QList<QByteArray> supportedMimeTypes = QImageReader::supportedMimeTypes();
|
const QList<QByteArray> supportedMimeTypes = QImageReader::supportedMimeTypes();
|
||||||
foreach (const QByteArray &format, supportedMimeTypes)
|
foreach (const QByteArray &format, supportedMimeTypes)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#include "actionhandler.h"
|
#include "actionhandler.h"
|
||||||
#include "modeleditor.h"
|
#include "modeleditor.h"
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
namespace ModelEditor {
|
namespace ModelEditor {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -46,7 +46,7 @@ ModelEditorFactory::ModelEditorFactory(UiController *uiController, QObject *pare
|
|||||||
d(new ModelEditorFactoryPrivate())
|
d(new ModelEditorFactoryPrivate())
|
||||||
{
|
{
|
||||||
setId(Constants::MODEL_EDITOR_ID);
|
setId(Constants::MODEL_EDITOR_ID);
|
||||||
setDisplayName(qApp->translate("OpenWith::Editors", Constants::MODEL_EDITOR_DISPLAY_NAME));
|
setDisplayName(QCoreApplication::translate("OpenWith::Editors", Constants::MODEL_EDITOR_DISPLAY_NAME));
|
||||||
addMimeType(Constants::MIME_TYPE_MODEL);
|
addMimeType(Constants::MIME_TYPE_MODEL);
|
||||||
d->uiController = uiController;
|
d->uiController = uiController;
|
||||||
d->actionHandler = new ActionHandler(Core::Context(Constants::MODEL_EDITOR_ID), this);
|
d->actionHandler = new ActionHandler(Core::Context(Constants::MODEL_EDITOR_ID), this);
|
||||||
|
|||||||
@@ -631,9 +631,9 @@ IEditor *PerforcePlugin::openPerforceSubmitEditor(const QString &fileName, const
|
|||||||
|
|
||||||
void PerforcePlugin::printPendingChanges()
|
void PerforcePlugin::printPendingChanges()
|
||||||
{
|
{
|
||||||
qApp->setOverrideCursor(Qt::WaitCursor);
|
QGuiApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
PendingChangesDialog dia(pendingChangesData(), ICore::mainWindow());
|
PendingChangesDialog dia(pendingChangesData(), ICore::mainWindow());
|
||||||
qApp->restoreOverrideCursor();
|
QGuiApplication::restoreOverrideCursor();
|
||||||
if (dia.exec() == QDialog::Accepted) {
|
if (dia.exec() == QDialog::Accepted) {
|
||||||
const int i = dia.changeNumber();
|
const int i = dia.changeNumber();
|
||||||
QStringList args(QLatin1String("submit"));
|
QStringList args(QLatin1String("submit"));
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ GDB 32bit | Api | Api | N/A | Win32
|
|||||||
+ Utils::winErrorMessage(GetLastError()));
|
+ Utils::winErrorMessage(GetLastError()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
bool creatorIs64Bit = Utils::is64BitWindowsBinary(qApp->applicationFilePath());
|
bool creatorIs64Bit = Utils::is64BitWindowsBinary(QCoreApplication::applicationFilePath());
|
||||||
if (!is64BitSystem
|
if (!is64BitSystem
|
||||||
|| si == NoSpecialInterrupt
|
|| si == NoSpecialInterrupt
|
||||||
|| (si == Win64Interrupt && creatorIs64Bit)
|
|| (si == Win64Interrupt && creatorIs64Bit)
|
||||||
|
|||||||
@@ -369,7 +369,7 @@ QWidget *SpacerField::createWidget(const QString &displayName, JsonFieldPage *pa
|
|||||||
{
|
{
|
||||||
Q_UNUSED(displayName);
|
Q_UNUSED(displayName);
|
||||||
Q_UNUSED(page);
|
Q_UNUSED(page);
|
||||||
int size = qApp->style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing) * m_factor;
|
int size = QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing) * m_factor;
|
||||||
|
|
||||||
auto w = new QWidget();
|
auto w = new QWidget();
|
||||||
w->setMinimumSize(size, size);
|
w->setMinimumSize(size, size);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <QApplication>
|
#include <QCoreApplication>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -64,7 +64,7 @@ WinDebugInterface::WinDebugInterface(QObject *parent) :
|
|||||||
QThread(parent)
|
QThread(parent)
|
||||||
{
|
{
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
m_creatorPid = qApp->applicationPid();
|
m_creatorPid = QCoreApplication::applicationPid();
|
||||||
setObjectName(QLatin1String("WinDebugInterfaceThread"));
|
setObjectName(QLatin1String("WinDebugInterfaceThread"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ static TextDocument *createProFileDocument()
|
|||||||
ProFileEditorFactory::ProFileEditorFactory()
|
ProFileEditorFactory::ProFileEditorFactory()
|
||||||
{
|
{
|
||||||
setId(Constants::PROFILE_EDITOR_ID);
|
setId(Constants::PROFILE_EDITOR_ID);
|
||||||
setDisplayName(qApp->translate("OpenWith::Editors", Constants::PROFILE_EDITOR_DISPLAY_NAME));
|
setDisplayName(QCoreApplication::translate("OpenWith::Editors", Constants::PROFILE_EDITOR_DISPLAY_NAME));
|
||||||
addMimeType(Constants::PROFILE_MIMETYPE);
|
addMimeType(Constants::PROFILE_MIMETYPE);
|
||||||
addMimeType(Constants::PROINCLUDEFILE_MIMETYPE);
|
addMimeType(Constants::PROINCLUDEFILE_MIMETYPE);
|
||||||
addMimeType(Constants::PROFEATUREFILE_MIMETYPE);
|
addMimeType(Constants::PROFEATUREFILE_MIMETYPE);
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ QmakeStaticData::QmakeStaticData()
|
|||||||
// Overlay the SP_DirIcon with the custom icons
|
// Overlay the SP_DirIcon with the custom icons
|
||||||
const QSize desiredSize = QSize(16, 16);
|
const QSize desiredSize = QSize(16, 16);
|
||||||
|
|
||||||
const QPixmap dirPixmap = qApp->style()->standardIcon(QStyle::SP_DirIcon).pixmap(desiredSize);
|
const QPixmap dirPixmap = QApplication::style()->standardIcon(QStyle::SP_DirIcon).pixmap(desiredSize);
|
||||||
for (unsigned i = 0 ; i < count; ++i) {
|
for (unsigned i = 0 ; i < count; ++i) {
|
||||||
const QIcon overlayIcon(QLatin1String(fileTypeDataStorage[i].icon));
|
const QIcon overlayIcon(QLatin1String(fileTypeDataStorage[i].icon));
|
||||||
QIcon folderIcon;
|
QIcon folderIcon;
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ SimpleProjectWizard::SimpleProjectWizard()
|
|||||||
QPixmap icon(22, 22);
|
QPixmap icon(22, 22);
|
||||||
icon.fill(Qt::transparent);
|
icon.fill(Qt::transparent);
|
||||||
QPainter p(&icon);
|
QPainter p(&icon);
|
||||||
p.drawPixmap(3, 3, 16, 16, qApp->style()->standardIcon(QStyle::SP_DirIcon).pixmap(16));
|
p.drawPixmap(3, 3, 16, 16, QApplication::style()->standardIcon(QStyle::SP_DirIcon).pixmap(16));
|
||||||
setIcon(icon);
|
setIcon(icon);
|
||||||
}
|
}
|
||||||
setDisplayName(tr("Import as qmake Project (Limited Functionality)"));
|
setDisplayName(tr("Import as qmake Project (Limited Functionality)"));
|
||||||
|
|||||||
@@ -1030,7 +1030,7 @@ bool QmlJSEditor::isDesignModePreferred() const
|
|||||||
QmlJSEditorFactory::QmlJSEditorFactory()
|
QmlJSEditorFactory::QmlJSEditorFactory()
|
||||||
{
|
{
|
||||||
setId(Constants::C_QMLJSEDITOR_ID);
|
setId(Constants::C_QMLJSEDITOR_ID);
|
||||||
setDisplayName(qApp->translate("OpenWith::Editors", Constants::C_QMLJSEDITOR_DISPLAY_NAME));
|
setDisplayName(QCoreApplication::translate("OpenWith::Editors", Constants::C_QMLJSEDITOR_DISPLAY_NAME));
|
||||||
|
|
||||||
addMimeType(QmlJSTools::Constants::QML_MIMETYPE);
|
addMimeType(QmlJSTools::Constants::QML_MIMETYPE);
|
||||||
addMimeType(QmlJSTools::Constants::QMLPROJECT_MIMETYPE);
|
addMimeType(QmlJSTools::Constants::QMLPROJECT_MIMETYPE);
|
||||||
|
|||||||
@@ -124,11 +124,11 @@ void FlameGraphViewTest::testContextMenu()
|
|||||||
int menuClicks = 0;
|
int menuClicks = 0;
|
||||||
|
|
||||||
connect(&timer, &QTimer::timeout, this, [&]() {
|
connect(&timer, &QTimer::timeout, this, [&]() {
|
||||||
auto activePopup = qApp->activePopupWidget();
|
auto activePopup = QApplication::activePopupWidget();
|
||||||
if (!activePopup || !activePopup->windowHandle()->isExposed()) {
|
if (!activePopup || !activePopup->windowHandle()->isExposed()) {
|
||||||
QContextMenuEvent *event = new QContextMenuEvent(QContextMenuEvent::Mouse,
|
QContextMenuEvent *event = new QContextMenuEvent(QContextMenuEvent::Mouse,
|
||||||
QPoint(250, 250));
|
QPoint(250, 250));
|
||||||
qApp->postEvent(&view, event);
|
QCoreApplication::postEvent(&view, event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ void LocalQmlProfilerRunnerTest::testRunner1()
|
|||||||
QTRY_VERIFY_WITH_TIMEOUT(!running, 10000);
|
QTRY_VERIFY_WITH_TIMEOUT(!running, 10000);
|
||||||
|
|
||||||
configuration.socket = connection.analyzerSocket = LocalQmlProfilerRunner::findFreeSocket();
|
configuration.socket = connection.analyzerSocket = LocalQmlProfilerRunner::findFreeSocket();
|
||||||
configuration.debuggee.executable = qApp->applicationFilePath();
|
configuration.debuggee.executable = QCoreApplication::applicationFilePath();
|
||||||
|
|
||||||
// comma is used to specify a test function. In this case, an invalid one.
|
// comma is used to specify a test function. In this case, an invalid one.
|
||||||
configuration.debuggee.commandLineArguments = QString("-test QmlProfiler,");
|
configuration.debuggee.commandLineArguments = QString("-test QmlProfiler,");
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ ResourceEditorFactory::ResourceEditorFactory(ResourceEditorPlugin *plugin) :
|
|||||||
{
|
{
|
||||||
setId(RESOURCEEDITOR_ID);
|
setId(RESOURCEEDITOR_ID);
|
||||||
setMimeTypes(QStringList(QLatin1String(C_RESOURCE_MIMETYPE)));
|
setMimeTypes(QStringList(QLatin1String(C_RESOURCE_MIMETYPE)));
|
||||||
setDisplayName(qApp->translate("OpenWith::Editors", C_RESOURCEEDITOR_DISPLAY_NAME));
|
setDisplayName(QCoreApplication::translate("OpenWith::Editors", C_RESOURCEEDITOR_DISPLAY_NAME));
|
||||||
|
|
||||||
Core::FileIconProvider::registerIconOverlayForSuffix(
|
Core::FileIconProvider::registerIconOverlayForSuffix(
|
||||||
ProjectExplorer::Constants::FILEOVERLAY_QRC, "qrc");
|
ProjectExplorer::Constants::FILEOVERLAY_QRC, "qrc");
|
||||||
|
|||||||
@@ -621,7 +621,7 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
|
|||||||
|
|
||||||
if (ke->text().length() == 1
|
if (ke->text().length() == 1
|
||||||
&& d->m_completionListView->currentIndex().isValid()
|
&& d->m_completionListView->currentIndex().isValid()
|
||||||
&& qApp->focusWidget() == o) {
|
&& QApplication::focusWidget() == o) {
|
||||||
const QChar &typedChar = ke->text().at(0);
|
const QChar &typedChar = ke->text().at(0);
|
||||||
AssistProposalItemInterface *item =
|
AssistProposalItemInterface *item =
|
||||||
d->m_model->proposalItem(d->m_completionListView->currentIndex().row());
|
d->m_model->proposalItem(d->m_completionListView->currentIndex().row());
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ PlainTextEditorFactory::PlainTextEditorFactory()
|
|||||||
QTC_CHECK(!m_instance);
|
QTC_CHECK(!m_instance);
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
setId(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID);
|
setId(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID);
|
||||||
setDisplayName(qApp->translate("OpenWith::Editors", Core::Constants::K_DEFAULT_TEXT_EDITOR_DISPLAY_NAME));
|
setDisplayName(QCoreApplication::translate("OpenWith::Editors", Core::Constants::K_DEFAULT_TEXT_EDITOR_DISPLAY_NAME));
|
||||||
addMimeType(QLatin1String(TextEditor::Constants::C_TEXTEDITOR_MIMETYPE_TEXT));
|
addMimeType(QLatin1String(TextEditor::Constants::C_TEXTEDITOR_MIMETYPE_TEXT));
|
||||||
addMimeType(QLatin1String("text/css")); // for some reason freedesktop thinks css is text/x-csrc
|
addMimeType(QLatin1String("text/css")); // for some reason freedesktop thinks css is text/x-csrc
|
||||||
addHoverHandler(new BaseHoverHandler);
|
addHoverHandler(new BaseHoverHandler);
|
||||||
|
|||||||
@@ -3488,7 +3488,7 @@ void TextEditorWidgetPrivate::disableBlockSelection(BlockSelectionUpdateKind kin
|
|||||||
void TextEditorWidgetPrivate::resetCursorFlashTimer()
|
void TextEditorWidgetPrivate::resetCursorFlashTimer()
|
||||||
{
|
{
|
||||||
m_cursorVisible = true;
|
m_cursorVisible = true;
|
||||||
const int flashTime = qApp->cursorFlashTime();
|
const int flashTime = QApplication::cursorFlashTime();
|
||||||
if (flashTime > 0) {
|
if (flashTime > 0) {
|
||||||
m_cursorFlashTimer.stop();
|
m_cursorFlashTimer.stop();
|
||||||
m_cursorFlashTimer.start(flashTime / 2, q);
|
m_cursorFlashTimer.start(flashTime / 2, q);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QGuiApplication>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
@@ -493,7 +493,7 @@ void Internal::TextEditorPlugin::testBlockSelectionCopy()
|
|||||||
editorWidget->update();
|
editorWidget->update();
|
||||||
editorWidget->copy();
|
editorWidget->copy();
|
||||||
|
|
||||||
QCOMPARE(qApp->clipboard()->text(), copiedText);
|
QCOMPARE(QGuiApplication::clipboard()->text(), copiedText);
|
||||||
}
|
}
|
||||||
Core::EditorManager::closeDocument(editor->document(), false);
|
Core::EditorManager::closeDocument(editor->document(), false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ void CompilerOutputProcessor::start()
|
|||||||
this, &CompilerOutputProcessor::handleTask);
|
this, &CompilerOutputProcessor::handleTask);
|
||||||
while (!m_source.atEnd())
|
while (!m_source.atEnd())
|
||||||
parser.stdError(QString::fromLocal8Bit(m_source.readLine().trimmed()));
|
parser.stdError(QString::fromLocal8Bit(m_source.readLine().trimmed()));
|
||||||
qApp->quit();
|
QCoreApplication::quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompilerOutputProcessor::handleTask(const ProjectExplorer::Task &task)
|
void CompilerOutputProcessor::handleTask(const ProjectExplorer::Task &task)
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ static QString example()
|
|||||||
#else
|
#else
|
||||||
QString::fromLatin1("$ echo \"int foo() {}\" | ./%1 && xdg-open %2.ast.png")
|
QString::fromLatin1("$ echo \"int foo() {}\" | ./%1 && xdg-open %2.ast.png")
|
||||||
#endif
|
#endif
|
||||||
.arg(QFileInfo(qApp->arguments().at(0)).fileName(), QLatin1String(PATH_STDIN_FILE));
|
.arg(QFileInfo(QCoreApplication::arguments().at(0)).fileName(), QLatin1String(PATH_STDIN_FILE));
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString parseModeToString(Document::ParseMode parseMode)
|
static QString parseModeToString(Document::ParseMode parseMode)
|
||||||
@@ -474,7 +474,7 @@ static Document::Ptr parse(const QString &fileName, const QByteArray &source,
|
|||||||
|
|
||||||
static void printUsage()
|
static void printUsage()
|
||||||
{
|
{
|
||||||
std::cout << "Usage: " << qPrintable(QFileInfo(qApp->arguments().at(0)).fileName())
|
std::cout << "Usage: " << qPrintable(QFileInfo(QCoreApplication::arguments().at(0)).fileName())
|
||||||
<< " [-v] [-p ast] <file1> <file2> ...\n\n";
|
<< " [-v] [-p ast] <file1> <file2> ...\n\n";
|
||||||
|
|
||||||
std::cout
|
std::cout
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ using namespace CPlusPlus;
|
|||||||
|
|
||||||
void printUsage()
|
void printUsage()
|
||||||
{
|
{
|
||||||
std::cout << "Usage: " << qPrintable(QFileInfo(qApp->arguments().at(0)).fileName())
|
std::cout << "Usage: " << qPrintable(QFileInfo(QCoreApplication::arguments().at(0)).fileName())
|
||||||
<< " [-v] <file1> <file2> ...\n\n"
|
<< " [-v] <file1> <file2> ...\n\n"
|
||||||
<< "Run the parser with the given files.\n";
|
<< "Run the parser with the given files.\n";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ protected:
|
|||||||
|
|
||||||
void printUsage()
|
void printUsage()
|
||||||
{
|
{
|
||||||
std::cout << "Usage: " << qPrintable(QFileInfo(qApp->arguments().at(0)).fileName())
|
std::cout << "Usage: " << qPrintable(QFileInfo(QCoreApplication::arguments().at(0)).fileName())
|
||||||
<< " [-v] [path to AST.h]\n\n"
|
<< " [-v] [path to AST.h]\n\n"
|
||||||
<< "Print a visitor class based on AST.h to stdout.\n\n";
|
<< "Print a visitor class based on AST.h to stdout.\n\n";
|
||||||
const QString defaulPath = QFileInfo(QLatin1String(PATH_AST_H)).canonicalFilePath();
|
const QString defaulPath = QFileInfo(QLatin1String(PATH_AST_H)).canonicalFilePath();
|
||||||
|
|||||||
@@ -1692,7 +1692,7 @@ void generateASTPatternBuilder_h(const QDir &cplusplusDir)
|
|||||||
|
|
||||||
void printUsage()
|
void printUsage()
|
||||||
{
|
{
|
||||||
const QByteArray executable = QFileInfo(qApp->arguments().first()).fileName().toLatin1();
|
const QByteArray executable = QFileInfo(QCoreApplication::arguments().first()).fileName().toLatin1();
|
||||||
std::cout << "Usage: " << executable.constData() << "\n"
|
std::cout << "Usage: " << executable.constData() << "\n"
|
||||||
<< " " << executable.constData() << " <frontend-dir> <dumpers-file>"
|
<< " " << executable.constData() << " <frontend-dir> <dumpers-file>"
|
||||||
<< "\n\n"
|
<< "\n\n"
|
||||||
|
|||||||
@@ -177,5 +177,5 @@ void CrashHandlerDialog::close()
|
|||||||
{
|
{
|
||||||
if (m_ui->restartAppCheckBox->isEnabled() && m_ui->restartAppCheckBox->isChecked())
|
if (m_ui->restartAppCheckBox->isEnabled() && m_ui->restartAppCheckBox->isChecked())
|
||||||
m_crashHandler->restartApplication();
|
m_crashHandler->restartApplication();
|
||||||
qApp->quit();
|
QCoreApplication::quit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ CrashHandlerSetup::CrashHandlerSetup(const QString &appName,
|
|||||||
disableRestartOptionC = "--disable-restart";
|
disableRestartOptionC = "--disable-restart";
|
||||||
|
|
||||||
const QString execDirPath = executableDirPath.isEmpty()
|
const QString execDirPath = executableDirPath.isEmpty()
|
||||||
? qApp->applicationDirPath()
|
? QCoreApplication::applicationDirPath()
|
||||||
: executableDirPath;
|
: executableDirPath;
|
||||||
const QString crashHandlerPath = execDirPath + QLatin1String("/qtcreator_crash_handler");
|
const QString crashHandlerPath = execDirPath + QLatin1String("/qtcreator_crash_handler");
|
||||||
crashHandlerPathC = qstrdup(qPrintable(crashHandlerPath));
|
crashHandlerPathC = qstrdup(qPrintable(crashHandlerPath));
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ const QString tabular(const Operation *o)
|
|||||||
void printHelp(const QList<Operation *> &operations)
|
void printHelp(const QList<Operation *> &operations)
|
||||||
{
|
{
|
||||||
std::cout << "Qt Creator SDK setup tool." << std::endl;
|
std::cout << "Qt Creator SDK setup tool." << std::endl;
|
||||||
std::cout << " Usage: " << qPrintable(qApp->arguments().at(0))
|
std::cout << " Usage: " << qPrintable(QCoreApplication::arguments().at(0))
|
||||||
<< " <ARGS> <OPERATION> <OPERATION_ARGS>" << std::endl << std::endl;
|
<< " <ARGS> <OPERATION> <OPERATION_ARGS>" << std::endl << std::endl;
|
||||||
std::cout << "ARGS:" << std::endl;
|
std::cout << "ARGS:" << std::endl;
|
||||||
std::cout << " --help|-h Print this help text" << std::endl;
|
std::cout << " --help|-h Print this help text" << std::endl;
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ void tst_TimelineZoomControl::window()
|
|||||||
verifyWindow(zoomControl);
|
verifyWindow(zoomControl);
|
||||||
zoomControl.setRange(102005, 102010); // make sure it doesn't overrun trace start
|
zoomControl.setRange(102005, 102010); // make sure it doesn't overrun trace start
|
||||||
} else if (zoomControl.windowStart() == zoomControl.traceStart()) {
|
} else if (zoomControl.windowStart() == zoomControl.traceStart()) {
|
||||||
qApp->exit();
|
QCoreApplication::exit();
|
||||||
} else {
|
} else {
|
||||||
QVERIFY(zoomControl.rangeStart() - zoomControl.windowStart() ==
|
QVERIFY(zoomControl.rangeStart() - zoomControl.windowStart() ==
|
||||||
zoomControl.windowEnd() - zoomControl.rangeEnd());
|
zoomControl.windowEnd() - zoomControl.rangeEnd());
|
||||||
@@ -146,7 +146,7 @@ void tst_TimelineZoomControl::window()
|
|||||||
verifyWindow(zoomControl);
|
verifyWindow(zoomControl);
|
||||||
});
|
});
|
||||||
|
|
||||||
qApp->exec();
|
QGuiApplication::exec();
|
||||||
|
|
||||||
disconnect(connection);
|
disconnect(connection);
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ ModelTestWidget::ModelTestWidget(CallgrindWidgetHandler *handler)
|
|||||||
connect(m_handler->flatView(), SIGNAL(customContextMenuRequested(QPoint)),
|
connect(m_handler->flatView(), SIGNAL(customContextMenuRequested(QPoint)),
|
||||||
this, SLOT(showViewContextMenu(QPoint)));
|
this, SLOT(showViewContextMenu(QPoint)));
|
||||||
|
|
||||||
resize(qMin(qApp->desktop()->width(), 1024), 600);
|
resize(qMin(QApplication::desktop()->width(), 1024), 600);
|
||||||
}
|
}
|
||||||
|
|
||||||
ModelTestWidget::~ModelTestWidget()
|
ModelTestWidget::~ModelTestWidget()
|
||||||
|
|||||||
@@ -114,27 +114,27 @@ private:
|
|||||||
void handleConnected()
|
void handleConnected()
|
||||||
{
|
{
|
||||||
qDebug("Error: Received unexpected connected() signal.");
|
qDebug("Error: Received unexpected connected() signal.");
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleDisconnected()
|
void handleDisconnected()
|
||||||
{
|
{
|
||||||
qDebug("Error: Received unexpected disconnected() signal.");
|
qDebug("Error: Received unexpected disconnected() signal.");
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleDataAvailable(const QString &msg)
|
void handleDataAvailable(const QString &msg)
|
||||||
{
|
{
|
||||||
qDebug("Error: Received unexpected dataAvailable() signal. "
|
qDebug("Error: Received unexpected dataAvailable() signal. "
|
||||||
"Message was: '%s'.", qPrintable(msg));
|
"Message was: '%s'.", qPrintable(msg));
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void handleError(QSsh::SshError error)
|
void handleError(QSsh::SshError error)
|
||||||
{
|
{
|
||||||
if (m_testSet.isEmpty()) {
|
if (m_testSet.isEmpty()) {
|
||||||
qDebug("Error: Received error %d, but no test was running.", error);
|
qDebug("Error: Received error %d, but no test was running.", error);
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
const TestItem testItem = m_testSet.takeFirst();
|
const TestItem testItem = m_testSet.takeFirst();
|
||||||
@@ -142,13 +142,13 @@ private:
|
|||||||
qDebug("Received error %d, as expected.", error);
|
qDebug("Received error %d, as expected.", error);
|
||||||
if (m_testSet.isEmpty()) {
|
if (m_testSet.isEmpty()) {
|
||||||
qDebug("All tests finished successfully.");
|
qDebug("All tests finished successfully.");
|
||||||
qApp->quit();
|
QCoreApplication::quit();
|
||||||
} else {
|
} else {
|
||||||
runNextTest();
|
runNextTest();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qDebug("Received unexpected error %d.", error);
|
qDebug("Received unexpected error %d.", error);
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ private:
|
|||||||
{
|
{
|
||||||
if (m_testSet.isEmpty()) {
|
if (m_testSet.isEmpty()) {
|
||||||
qDebug("Error: timeout, but no test was running.");
|
qDebug("Error: timeout, but no test was running.");
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
const TestItem testItem = m_testSet.takeFirst();
|
const TestItem testItem = m_testSet.takeFirst();
|
||||||
qDebug("Error: The following test timed out: %s", testItem.description);
|
qDebug("Error: The following test timed out: %s", testItem.description);
|
||||||
|
|||||||
@@ -79,14 +79,14 @@ void RemoteProcessTest::handleConnectionError()
|
|||||||
? m_sshConnection->errorString() : m_remoteRunner->lastConnectionErrorString();
|
? m_sshConnection->errorString() : m_remoteRunner->lastConnectionErrorString();
|
||||||
|
|
||||||
std::cerr << "Error: Connection failure (" << qPrintable(error) << ")." << std::endl;
|
std::cerr << "Error: Connection failure (" << qPrintable(error) << ")." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteProcessTest::handleProcessStarted()
|
void RemoteProcessTest::handleProcessStarted()
|
||||||
{
|
{
|
||||||
if (m_started) {
|
if (m_started) {
|
||||||
std::cerr << "Error: Received started() signal again." << std::endl;
|
std::cerr << "Error: Received started() signal again." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
} else {
|
} else {
|
||||||
m_started = true;
|
m_started = true;
|
||||||
if (m_state == TestingCrash) {
|
if (m_state == TestingCrash) {
|
||||||
@@ -107,11 +107,11 @@ void RemoteProcessTest::handleProcessStdout()
|
|||||||
if (!m_started) {
|
if (!m_started) {
|
||||||
std::cerr << "Error: Remote output from non-started process."
|
std::cerr << "Error: Remote output from non-started process."
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
} else if (m_state != TestingSuccess && m_state != TestingTerminal) {
|
} else if (m_state != TestingSuccess && m_state != TestingTerminal) {
|
||||||
std::cerr << "Error: Got remote standard output in state " << m_state
|
std::cerr << "Error: Got remote standard output in state " << m_state
|
||||||
<< "." << std::endl;
|
<< "." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
} else {
|
} else {
|
||||||
m_remoteStdout += m_remoteRunner->readAllStandardOutput();
|
m_remoteStdout += m_remoteRunner->readAllStandardOutput();
|
||||||
}
|
}
|
||||||
@@ -122,11 +122,11 @@ void RemoteProcessTest::handleProcessStderr()
|
|||||||
if (!m_started) {
|
if (!m_started) {
|
||||||
std::cerr << "Error: Remote error output from non-started process."
|
std::cerr << "Error: Remote error output from non-started process."
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
} else if (m_state == TestingSuccess) {
|
} else if (m_state == TestingSuccess) {
|
||||||
std::cerr << "Error: Unexpected remote standard error output."
|
std::cerr << "Error: Unexpected remote standard error output."
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
} else {
|
} else {
|
||||||
m_remoteStderr += m_remoteRunner->readAllStandardError();
|
m_remoteStderr += m_remoteRunner->readAllStandardError();
|
||||||
}
|
}
|
||||||
@@ -138,7 +138,7 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus)
|
|||||||
case SshRemoteProcess::NormalExit:
|
case SshRemoteProcess::NormalExit:
|
||||||
if (!m_started) {
|
if (!m_started) {
|
||||||
std::cerr << "Error: Process exited without starting." << std::endl;
|
std::cerr << "Error: Process exited without starting." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (m_state) {
|
switch (m_state) {
|
||||||
@@ -147,13 +147,13 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus)
|
|||||||
if (exitCode != 0) {
|
if (exitCode != 0) {
|
||||||
std::cerr << "Error: exit code is " << exitCode
|
std::cerr << "Error: exit code is " << exitCode
|
||||||
<< ", expected zero." << std::endl;
|
<< ", expected zero." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_remoteStdout.isEmpty()) {
|
if (m_remoteStdout.isEmpty()) {
|
||||||
std::cerr << "Error: Command did not produce output."
|
std::cerr << "Error: Command did not produce output."
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,12 +169,12 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus)
|
|||||||
if (exitCode == 0) {
|
if (exitCode == 0) {
|
||||||
std::cerr << "Error: exit code is zero, expected non-zero."
|
std::cerr << "Error: exit code is zero, expected non-zero."
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_remoteStderr.isEmpty()) {
|
if (m_remoteStderr.isEmpty()) {
|
||||||
std::cerr << "Error: Command did not produce error output." << std::flush;
|
std::cerr << "Error: Command did not produce error output." << std::flush;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus)
|
|||||||
if (m_remoteRunner->processExitCode() == 0) {
|
if (m_remoteRunner->processExitCode() == 0) {
|
||||||
std::cerr << "Error: Successful exit from process that was "
|
std::cerr << "Error: Successful exit from process that was "
|
||||||
"supposed to crash." << std::endl;
|
"supposed to crash." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
} else {
|
} else {
|
||||||
// Some shells (e.g. mksh) don't report "killed", but just a non-zero exit code.
|
// Some shells (e.g. mksh) don't report "killed", but just a non-zero exit code.
|
||||||
handleSuccessfulCrashTest();
|
handleSuccessfulCrashTest();
|
||||||
@@ -200,13 +200,13 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus)
|
|||||||
if (exitCode != 0) {
|
if (exitCode != 0) {
|
||||||
std::cerr << "Error: exit code is " << exitCode
|
std::cerr << "Error: exit code is " << exitCode
|
||||||
<< ", expected zero." << std::endl;
|
<< ", expected zero." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_remoteStdout.isEmpty()) {
|
if (m_remoteStdout.isEmpty()) {
|
||||||
std::cerr << "Error: Command did not produce output."
|
std::cerr << "Error: Command did not produce output."
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::cout << "Ok.\nTesting I/O device functionality... " << std::flush;
|
std::cout << "Ok.\nTesting I/O device functionality... " << std::flush;
|
||||||
@@ -224,7 +224,7 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus)
|
|||||||
if (m_catProcess->exitCode() == 0) {
|
if (m_catProcess->exitCode() == 0) {
|
||||||
std::cerr << "Error: Successful exit from process that was supposed to crash."
|
std::cerr << "Error: Successful exit from process that was supposed to crash."
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
} else {
|
} else {
|
||||||
handleSuccessfulIoTest();
|
handleSuccessfulIoTest();
|
||||||
}
|
}
|
||||||
@@ -232,17 +232,17 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus)
|
|||||||
case TestingProcessChannels:
|
case TestingProcessChannels:
|
||||||
if (m_remoteStderr.isEmpty()) {
|
if (m_remoteStderr.isEmpty()) {
|
||||||
std::cerr << "Error: Did not receive readyReadStderr()." << std::endl;
|
std::cerr << "Error: Did not receive readyReadStderr()." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_remoteData != StderrOutput) {
|
if (m_remoteData != StderrOutput) {
|
||||||
std::cerr << "Error: Expected output '" << StderrOutput.data() << "', received '"
|
std::cerr << "Error: Expected output '" << StderrOutput.data() << "', received '"
|
||||||
<< m_remoteData.data() << "'." << std::endl;
|
<< m_remoteData.data() << "'." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::cout << "Ok.\nAll tests succeeded." << std::endl;
|
std::cout << "Ok.\nAll tests succeeded." << std::endl;
|
||||||
qApp->quit();
|
QCoreApplication::quit();
|
||||||
break;
|
break;
|
||||||
case Inactive:
|
case Inactive:
|
||||||
Q_ASSERT(false);
|
Q_ASSERT(false);
|
||||||
@@ -255,7 +255,7 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus)
|
|||||||
} else {
|
} else {
|
||||||
std::cerr << "Error: Process failed to start." << std::endl;
|
std::cerr << "Error: Process failed to start." << std::endl;
|
||||||
}
|
}
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
break;
|
break;
|
||||||
case SshRemoteProcess::CrashExit:
|
case SshRemoteProcess::CrashExit:
|
||||||
switch (m_state) {
|
switch (m_state) {
|
||||||
@@ -267,7 +267,7 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
std::cerr << "Error: Unexpected crash." << std::endl;
|
std::cerr << "Error: Unexpected crash." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -276,7 +276,7 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus)
|
|||||||
void RemoteProcessTest::handleTimeout()
|
void RemoteProcessTest::handleTimeout()
|
||||||
{
|
{
|
||||||
std::cerr << "Error: Timeout waiting for progress." << std::endl;
|
std::cerr << "Error: Timeout waiting for progress." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteProcessTest::handleConnected()
|
void RemoteProcessTest::handleConnected()
|
||||||
@@ -306,7 +306,7 @@ void RemoteProcessTest::handleReadyRead()
|
|||||||
if (data != testString()) {
|
if (data != testString()) {
|
||||||
std::cerr << "Testing of QIODevice functionality failed: Expected '"
|
std::cerr << "Testing of QIODevice functionality failed: Expected '"
|
||||||
<< qPrintable(testString()) << "', got '" << qPrintable(data) << "'." << std::endl;
|
<< qPrintable(testString()) << "', got '" << qPrintable(data) << "'." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
SshRemoteProcessRunner * const killer = new SshRemoteProcessRunner(this);
|
SshRemoteProcessRunner * const killer = new SshRemoteProcessRunner(this);
|
||||||
killer->run("pkill -9 cat", m_sshParams);
|
killer->run("pkill -9 cat", m_sshParams);
|
||||||
@@ -326,7 +326,7 @@ void RemoteProcessTest::handleReadyReadStdout()
|
|||||||
Q_ASSERT(m_state == TestingProcessChannels);
|
Q_ASSERT(m_state == TestingProcessChannels);
|
||||||
|
|
||||||
std::cerr << "Error: Received unexpected stdout data." << std::endl;
|
std::cerr << "Error: Received unexpected stdout data." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteProcessTest::handleReadyReadStderr()
|
void RemoteProcessTest::handleReadyReadStderr()
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ void SftpTest::handleDisconnected()
|
|||||||
else
|
else
|
||||||
std::cout << "No errors encountered.";
|
std::cout << "No errors encountered.";
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
qApp->exit(m_error ? EXIT_FAILURE : EXIT_SUCCESS);
|
QCoreApplication::exit(m_error ? EXIT_FAILURE : EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SftpTest::handleError()
|
void SftpTest::handleError()
|
||||||
@@ -114,7 +114,7 @@ void SftpTest::handleError()
|
|||||||
<< qPrintable(m_connection->errorString()) << "." << std::endl;
|
<< qPrintable(m_connection->errorString()) << "." << std::endl;
|
||||||
m_error = true;
|
m_error = true;
|
||||||
m_state = Disconnecting;
|
m_state = Disconnecting;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SftpTest::handleChannelInitialized()
|
void SftpTest::handleChannelInitialized()
|
||||||
|
|||||||
@@ -114,5 +114,5 @@ void SftpFsWindow::handleConnectionError(const QString &errorMessage)
|
|||||||
{
|
{
|
||||||
QMessageBox::warning(this, tr("Connection Error"),
|
QMessageBox::warning(this, tr("Connection Error"),
|
||||||
tr("Fatal SSH error: %1").arg(errorMessage));
|
tr("Fatal SSH error: %1").arg(errorMessage));
|
||||||
qApp->quit();
|
QCoreApplication::quit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ void Shell::run()
|
|||||||
{
|
{
|
||||||
if (!m_stdin->open(stdin, QIODevice::ReadOnly | QIODevice::Unbuffered)) {
|
if (!m_stdin->open(stdin, QIODevice::ReadOnly | QIODevice::Unbuffered)) {
|
||||||
std::cerr << "Error: Cannot read from standard input." << std::endl;
|
std::cerr << "Error: Cannot read from standard input." << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ void Shell::run()
|
|||||||
void Shell::handleConnectionError()
|
void Shell::handleConnectionError()
|
||||||
{
|
{
|
||||||
std::cerr << "SSH connection error: " << qPrintable(m_connection->errorString()) << std::endl;
|
std::cerr << "SSH connection error: " << qPrintable(m_connection->errorString()) << std::endl;
|
||||||
qApp->exit(EXIT_FAILURE);
|
QCoreApplication::exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Shell::handleShellMessage(const QString &message)
|
void Shell::handleShellMessage(const QString &message)
|
||||||
@@ -106,7 +106,7 @@ void Shell::handleChannelClosed(int exitStatus)
|
|||||||
{
|
{
|
||||||
std::cerr << "Shell closed. Exit status was " << exitStatus << ", exit code was "
|
std::cerr << "Shell closed. Exit status was " << exitStatus << ", exit code was "
|
||||||
<< m_shell->exitCode() << "." << std::endl;
|
<< m_shell->exitCode() << "." << std::endl;
|
||||||
qApp->exit(exitStatus == SshRemoteProcess::NormalExit && m_shell->exitCode() == 0
|
QCoreApplication::exit(exitStatus == SshRemoteProcess::NormalExit && m_shell->exitCode() == 0
|
||||||
? EXIT_SUCCESS : EXIT_FAILURE);
|
? EXIT_SUCCESS : EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user