forked from qt-creator/qt-creator
MinimizableInfoBars: Move to Utils
Change-Id: I6b42948c4bddaa396122b845c5c1e2aa70d8aaad Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -88,6 +88,8 @@ add_qtc_library(Utils
|
||||
macroexpander.cpp macroexpander.h
|
||||
mapreduce.h
|
||||
mimeutils.h
|
||||
minimizableinfobars.cpp
|
||||
minimizableinfobars.h
|
||||
multitextcursor.cpp multitextcursor.h
|
||||
namevaluedictionary.cpp namevaluedictionary.h
|
||||
namevaluedictionary.cpp namevaluedictionary.h
|
||||
|
@@ -216,6 +216,11 @@ void InfoBar::initialize(QSettings *settings)
|
||||
}
|
||||
}
|
||||
|
||||
QSettings *InfoBar::settings()
|
||||
{
|
||||
return m_settings;
|
||||
}
|
||||
|
||||
void InfoBar::clearGloballySuppressed()
|
||||
{
|
||||
globallySuppressed.clear();
|
||||
|
@@ -124,6 +124,7 @@ public:
|
||||
static bool anyGloballySuppressed();
|
||||
|
||||
static void initialize(QSettings *settings);
|
||||
static QSettings *settings();
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
@@ -23,23 +23,18 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "cppminimizableinfobars.h"
|
||||
#include "minimizableinfobars.h"
|
||||
|
||||
#include "qtcassert.h"
|
||||
#include "qtcsettings.h"
|
||||
#include "utilsicons.h"
|
||||
|
||||
#include <QToolButton>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <utils/infobar.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
const char SETTINGS_PREFIX[] = "ShowInfoBarFor";
|
||||
const bool kShowInInfoBarDefault = true;
|
||||
|
||||
using namespace Core;
|
||||
using namespace Utils;
|
||||
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
namespace Utils {
|
||||
|
||||
MinimizableInfoBars::MinimizableInfoBars(InfoBar &infoBar)
|
||||
: m_infoBar(infoBar)
|
||||
@@ -147,13 +142,15 @@ void MinimizableInfoBars::showInfoBar(const Id &id)
|
||||
|
||||
bool MinimizableInfoBars::showInInfoBar(const Id &id) const
|
||||
{
|
||||
return ICore::settings()->value(settingsKey(id), kShowInInfoBarDefault).toBool();
|
||||
return InfoBar::settings()->value(settingsKey(id), kShowInInfoBarDefault).toBool();
|
||||
}
|
||||
|
||||
void MinimizableInfoBars::setShowInInfoBar(const Id &id, bool show)
|
||||
{
|
||||
ICore::settings()->setValueWithDefault(settingsKey(id), show, kShowInInfoBarDefault);
|
||||
QtcSettings::setValueWithDefault(InfoBar::settings(),
|
||||
settingsKey(id),
|
||||
show,
|
||||
kShowInInfoBarDefault);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace CppEditor
|
||||
} // namespace Utils
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
@@ -25,8 +25,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <utils/id.h>
|
||||
#include <utils/infobar.h>
|
||||
#include "utils_global.h"
|
||||
|
||||
#include "id.h"
|
||||
#include "infobar.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QHash>
|
||||
@@ -34,10 +36,9 @@
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace CppEditor {
|
||||
namespace Internal {
|
||||
namespace Utils {
|
||||
|
||||
class MinimizableInfoBars : public QObject
|
||||
class QTCREATOR_UTILS_EXPORT MinimizableInfoBars : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -73,5 +74,4 @@ private:
|
||||
QHash<Utils::Id, Utils::InfoBarEntry> m_infoEntries;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace CppEditor
|
||||
} // namespace Utils
|
@@ -182,6 +182,8 @@ Project {
|
||||
"macroexpander.h",
|
||||
"mapreduce.h",
|
||||
"mimeutils.h",
|
||||
"minimizableinfobars.cpp",
|
||||
"minimizableinfobars.h",
|
||||
"multitextcursor.cpp",
|
||||
"multitextcursor.h",
|
||||
"namevaluedictionary.cpp",
|
||||
|
@@ -60,7 +60,6 @@ add_qtc_plugin(CppEditor
|
||||
cpplocalsymbols.cpp cpplocalsymbols.h
|
||||
cpplocatordata.cpp cpplocatordata.h
|
||||
cpplocatorfilter.cpp cpplocatorfilter.h
|
||||
cppminimizableinfobars.cpp cppminimizableinfobars.h
|
||||
cppmodelmanager.cpp cppmodelmanager.h
|
||||
cppmodelmanagersupport.cpp cppmodelmanagersupport.h
|
||||
cppoutline.cpp cppoutline.h
|
||||
|
@@ -138,8 +138,6 @@ QtcPlugin {
|
||||
"cpplocatordata.h",
|
||||
"cpplocatorfilter.cpp",
|
||||
"cpplocatorfilter.h",
|
||||
"cppminimizableinfobars.cpp",
|
||||
"cppminimizableinfobars.h",
|
||||
"cppmodelmanager.cpp",
|
||||
"cppmodelmanager.h",
|
||||
"cppmodelmanagersupport.cpp",
|
||||
|
@@ -413,7 +413,7 @@ QFuture<CursorInfo> CppEditorDocument::cursorInfo(const CursorInfoParams ¶ms
|
||||
return processor()->cursorInfo(params);
|
||||
}
|
||||
|
||||
const MinimizableInfoBars &CppEditorDocument::minimizableInfoBars() const
|
||||
const Utils::MinimizableInfoBars &CppEditorDocument::minimizableInfoBars() const
|
||||
{
|
||||
return m_minimizableInfoBars;
|
||||
}
|
||||
|
@@ -27,13 +27,13 @@
|
||||
|
||||
#include "baseeditordocumentprocessor.h"
|
||||
#include "cppcompletionassistprovider.h"
|
||||
#include "cppminimizableinfobars.h"
|
||||
#include "cppmodelmanager.h"
|
||||
#include "cppparsecontext.h"
|
||||
#include "cppsemanticinfo.h"
|
||||
#include "editordocumenthandle.h"
|
||||
|
||||
#include <texteditor/textdocument.h>
|
||||
#include <utils/minimizableinfobars.h>
|
||||
|
||||
#include <QMutex>
|
||||
#include <QTimer>
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
|
||||
void scheduleProcessDocument();
|
||||
|
||||
const MinimizableInfoBars &minimizableInfoBars() const;
|
||||
const Utils::MinimizableInfoBars &minimizableInfoBars() const;
|
||||
ParseContextModel &parseContextModel();
|
||||
|
||||
QFuture<CursorInfo> cursorInfo(const CursorInfoParams ¶ms);
|
||||
@@ -135,7 +135,7 @@ private:
|
||||
// (Un)Registration in CppModelManager
|
||||
QScopedPointer<CppEditorDocumentHandle> m_editorDocumentHandle;
|
||||
|
||||
MinimizableInfoBars m_minimizableInfoBars;
|
||||
Utils::MinimizableInfoBars m_minimizableInfoBars;
|
||||
ParseContextModel m_parseContextModel;
|
||||
};
|
||||
|
||||
|
@@ -39,7 +39,6 @@
|
||||
#include "cppfunctiondecldeflink.h"
|
||||
#include "cpphighlighter.h"
|
||||
#include "cpplocalrenaming.h"
|
||||
#include "cppminimizableinfobars.h"
|
||||
#include "cppmodelmanager.h"
|
||||
#include "cpppreprocessordialog.h"
|
||||
#include "cppsemanticinfo.h"
|
||||
|
Reference in New Issue
Block a user