Commit a3d4cadb authored by Filip Gawin's avatar Filip Gawin
Browse files

Initialize overlooked variables (and remove redundant calls)

parent e2723b8b
......@@ -23,8 +23,7 @@
#include <QDir>
BtFileIndexer::BtFileIndexer(KateBtDatabase *database)
: QThread()
, cancelAsap(false)
: cancelAsap(false)
, db(database)
{
}
......
......@@ -72,7 +72,6 @@ void CloseExceptPlugin::writeSessionConfig(KConfigGroup &config)
// BEGIN CloseExceptPluginView
CloseExceptPluginView::CloseExceptPluginView(KTextEditor::MainWindow *mw, CloseExceptPlugin *plugin)
: QObject(mw)
, KXMLGUIClient()
, m_plugin(plugin)
, m_show_confirmation_action(new KToggleAction(i18nc("@action:inmenu", "Show Confirmation"), this))
, m_except_menu(new KActionMenu(i18nc("@action:inmenu close docs except the following...", "Close Except"), this))
......
......@@ -125,7 +125,7 @@ public Q_SLOTS:
}
private:
bool m_show_confirmation_needed;
bool m_show_confirmation_needed = false;
};
} // namespace kate
......
......@@ -29,7 +29,6 @@
KateBookmarkHandler::KateBookmarkHandler(KateFileBrowser *parent, QMenu *kpopupmenu)
: QObject(parent)
, KBookmarkOwner()
, mParent(parent)
, m_menu(kpopupmenu)
{
......
......@@ -103,11 +103,11 @@ public:
private:
KToolBar *m_toolbar;
KActionCollection *m_actionCollection;
KateBookmarkHandler *m_bookmarkHandler;
KateBookmarkHandler *m_bookmarkHandler = nullptr;
KUrlNavigator *m_urlNavigator;
KDirOperator *m_dirOperator;
KHistoryComboBox *m_filter;
QAction *m_autoSyncFolder;
QAction *m_autoSyncFolder = nullptr;
KTextEditor::MainWindow *m_mainWindow;
};
......
......@@ -42,7 +42,6 @@ public:
ResultNode(const QString &_name, const bool _dir = false)
: name(_name)
, dir(_dir)
, children()
{
}
......
......@@ -63,7 +63,7 @@ public Q_SLOTS:
private:
QList<KateFileTreePluginView *> m_views;
KateFileTreeConfigPage *m_confPage;
KateFileTreeConfigPage *m_confPage = nullptr;
KateFileTreePluginSettings m_settings;
};
......@@ -117,7 +117,7 @@ private:
KateFileTree *m_fileTree;
KateFileTreeProxyModel *m_proxyModel;
KateFileTreeModel *m_documentModel;
bool m_hasLocalPrefs;
bool m_hasLocalPrefs = false;
bool m_loadingDocuments;
KateFileTreePlugin *m_plug;
KTextEditor::MainWindow *m_mainWindow;
......
......@@ -94,7 +94,7 @@ private:
private:
KTextEditor::MainWindow *m_mainWindow;
QComboBox *m_targetCombo;
int m_currentTarget;
int m_currentTarget = 0;
QToolButton *m_addTarget;
QToolButton *m_copyTarget;
QToolButton *m_deleteTarget;
......@@ -117,7 +117,7 @@ private:
QLabel *m_execLabel;
QLabel *m_workDirLabel;
QLabel *m_argumentsLabel;
KSelectAction *m_targetSelectAction;
KSelectAction *m_targetSelectAction = nullptr;
AdvancedGDBSettings *m_advanced;
};
......
......@@ -111,7 +111,7 @@ private:
QString m_currentFile;
QString m_newFrameFile;
int m_newFrameLevel;
int m_newFrameLevel = 0;
QStringList m_nextCommands;
QString m_lastCommand;
bool m_debugLocationChanged;
......
......@@ -76,11 +76,11 @@ private:
QFile m_stdoutD;
QFile m_stderrD;
int m_stdoutFD;
int m_stderrFD;
int m_stdoutFD = 0;
int m_stderrFD = 0;
QSocketNotifier *m_stdoutNotifier;
QSocketNotifier *m_stderrNotifier;
QSocketNotifier *m_stdoutNotifier = nullptr;
QSocketNotifier *m_stderrNotifier = nullptr;
};
#endif
......@@ -86,7 +86,7 @@ private:
QProcess m_proc;
KateCTagsPlugin *m_plugin;
Ui_CTagsGlobalConfig m_confUi;
Ui_CTagsGlobalConfig m_confUi{};
};
#endif
......@@ -97,7 +97,7 @@ private:
QPointer<KTextEditor::MainWindow> m_mWin;
QPointer<QWidget> m_toolView;
Ui::kateCtags m_ctagsUi;
Ui::kateCtags m_ctagsUi{};
QPointer<KActionMenu> m_menu;
QAction *m_gotoDef;
......
......@@ -130,7 +130,7 @@ private:
KTextEditor::MainWindow *m_win;
QWidget *m_toolView;
Ui::build m_buildUi;
Ui::build m_buildUi{};
QWidget *m_buildWidget;
int m_outputWidgetWidth;
TargetsUi *m_targetsUi;
......@@ -145,10 +145,10 @@ private:
QRegularExpression m_filenameDetector;
QRegularExpression m_filenameDetectorIcpc;
bool m_filenameDetectorGccWorked;
bool m_ninjaBuildDetected;
bool m_ninjaBuildDetected = false;
QRegularExpression m_newDirDetector;
unsigned int m_numErrors;
unsigned int m_numWarnings;
unsigned int m_numErrors = 0;
unsigned int m_numWarnings = 0;
QString m_prevItemContent;
QModelIndex m_previousIndex;
QPointer<KTextEditor::Message> m_infoMessage;
......
......@@ -46,7 +46,7 @@ public Q_SLOTS:
void defaults() override;
private:
KateSQLPlugin *m_plugin;
KateSQLPlugin *m_plugin = nullptr;
QCheckBox *m_box;
OutputStyleWidget *m_outputStyleWidget;
......
......@@ -53,7 +53,6 @@
KateSQLView::KateSQLView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mw)
: QObject(mw)
, KXMLGUIClient()
, m_manager(new SQLManager(this))
, m_mainWindow(mw)
{
......
......@@ -214,7 +214,7 @@ void LSPClientConfigPage::updateConfigTextErrorState()
}
// check json validity
QJsonParseError error;
QJsonParseError error{};
auto json = QJsonDocument::fromJson(data, &error);
if (error.error == QJsonParseError::NoError) {
if (json.isObject()) {
......
......@@ -48,8 +48,7 @@ class LSPClientHoverImpl : public LSPClientHover
public:
LSPClientHoverImpl(QSharedPointer<LSPClientServerManager> manager)
: LSPClientHover()
, m_manager(std::move(manager))
: m_manager(std::move(manager))
, m_server(nullptr)
{
}
......
......@@ -54,22 +54,22 @@ public:
const QUrl m_defaultConfigPath;
// settings
bool m_symbolDetails;
bool m_symbolExpand;
bool m_symbolTree;
bool m_symbolSort;
bool m_complDoc;
bool m_refDeclaration;
bool m_diagnostics;
bool m_diagnosticsHighlight;
bool m_diagnosticsMark;
bool m_messages;
int m_messagesAutoSwitch;
bool m_autoHover;
bool m_onTypeFormatting;
bool m_incrementalSync;
bool m_symbolDetails = false;
bool m_symbolExpand = false;
bool m_symbolTree = false;
bool m_symbolSort = false;
bool m_complDoc = false;
bool m_refDeclaration = false;
bool m_diagnostics = false;
bool m_diagnosticsHighlight = false;
bool m_diagnosticsMark = false;
bool m_messages = false;
int m_messagesAutoSwitch = 0;
bool m_autoHover = false;
bool m_onTypeFormatting = false;
bool m_incrementalSync = false;
QUrl m_configPath;
bool m_semanticHighlighting;
bool m_semanticHighlighting = false;
// debug mode?
bool m_debugMode = false;
......
......@@ -620,7 +620,7 @@ private:
if (f.open(QIODevice::ReadOnly)) {
const auto data = f.readAll();
if (!data.isEmpty()) {
QJsonParseError error;
QJsonParseError error{};
auto json = QJsonDocument::fromJson(data, &error);
if (error.error == QJsonParseError::NoError) {
if (json.isObject()) {
......
......@@ -41,7 +41,6 @@ K_PLUGIN_FACTORY_WITH_JSON(KateOpenHeaderFactory, "kateopenheaderplugin.json", r
PluginViewKateOpenHeader::PluginViewKateOpenHeader(PluginKateOpenHeader *plugin, KTextEditor::MainWindow *mainwindow)
: KTextEditor::Command(QStringList() << QStringLiteral("toggle-header"), mainwindow)
, KXMLGUIClient()
, m_plugin(plugin)
, m_mainWindow(mainwindow)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment