Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a3d4cadb authored by Filip Gawin's avatar Filip Gawin

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)
{
......
......@@ -39,9 +39,7 @@
#include <utility>
KateProject::KateProject(ThreadWeaver::Queue *weaver, KateProjectPlugin *plugin)
: QObject()
, m_fileLastModified()
, m_notesDocument(nullptr)
: m_notesDocument(nullptr)
, m_untrackedDocumentsRoot(nullptr)
, m_weaver(weaver)
, m_plugin(plugin)
......@@ -100,7 +98,7 @@ QVariantMap KateProject::readProjectFile() const
* parse the whole file, bail out again on error!
*/
const QByteArray jsonData = file.readAll();
QJsonParseError parseError;
QJsonParseError parseError{};
QJsonDocument project(QJsonDocument::fromJson(jsonData, &parseError));
if (parseError.error != QJsonParseError::NoError) {
......
......@@ -91,7 +91,7 @@ private:
/**
* automatic invocation?
*/
bool m_automatic;
bool m_automatic = false;
};
#endif
......@@ -30,8 +30,7 @@
#include <QFileInfo>
KateProjectInfoView::KateProjectInfoView(KateProjectPluginView *pluginView, KateProject *project)
: QTabWidget()
, m_pluginView(pluginView)
: m_pluginView(pluginView)
, m_project(project)
{
/**
......
......@@ -32,8 +32,7 @@
#include <kmessagewidget.h>
KateProjectInfoViewCodeAnalysis::KateProjectInfoViewCodeAnalysis(KateProjectPluginView *pluginView, KateProject *project)
: QWidget()
, m_pluginView(pluginView)
: m_pluginView(pluginView)
, m_project(project)
, m_messageWidget(nullptr)
, m_startStopAnalysis(new QPushButton(i18n("Start Analysis...")))
......
......@@ -24,8 +24,7 @@
#include <QVBoxLayout>
KateProjectInfoViewNotes::KateProjectInfoViewNotes(KateProjectPluginView *pluginView, KateProject *project)
: QWidget()
, m_pluginView(pluginView)
: m_pluginView(pluginView)
, m_project(project)
, m_edit(new QPlainTextEdit())
{
......
......@@ -28,8 +28,7 @@
KPluginFactory *KateProjectInfoViewTerminal::s_pluginFactory = nullptr;
KateProjectInfoViewTerminal::KateProjectInfoViewTerminal(KateProjectPluginView *pluginView, const QString &directory)
: QWidget()
, m_pluginView(pluginView)
: m_pluginView(pluginView)
, m_directory(directory)
, m_konsolePart(nullptr)
{
......
......@@ -67,6 +67,9 @@ KateProjectPlugin::KateProjectPlugin(QObject *parent, const QList<QVariant> &)
, m_autoGit(true)
, m_autoSubversion(true)
, m_autoMercurial(true)
, m_indexEnabled(false)
, m_multiProjectCompletion(false)
, m_multiProjectGoto(false)
, m_weaver(new ThreadWeaver::Queue(this))
{
qRegisterMetaType<KateProjectSharedQStandardItem>("KateProjectSharedQStandardItem");
......
......@@ -32,8 +32,7 @@
#include <QVBoxLayout>
KateProjectView::KateProjectView(KateProjectPluginView *pluginView, KateProject *project)
: QWidget()
, m_pluginView(pluginView)
: m_pluginView(pluginView)
, m_project(project)
, m_treeView(new KateProjectViewTree(pluginView, project))
, m_filter(new KLineEdit())
......
......@@ -30,8 +30,7 @@
#include <QSortFilterProxyModel>
KateProjectViewTree::KateProjectViewTree(KateProjectPluginView *pluginView, KateProject *project)
: QTreeView()
, m_pluginView(pluginView)
: m_pluginView(pluginView)
, m_project(project)
{
/**
......
......@@ -32,9 +32,7 @@
#include <QTime>
KateProjectWorker::KateProjectWorker(const QString &baseDir, const QString &indexDir, const QVariantMap &projectMap, bool force)
: QObject()
, ThreadWeaver::Job()
, m_baseDir(baseDir)
: m_baseDir(baseDir)
, m_indexDir(indexDir)
, m_projectMap(projectMap)
, m_force(force)
......
......@@ -91,7 +91,7 @@ private:
/**
* our project, only as QObject, we only send messages back and forth!
*/
QObject *m_project;
QObject *m_project = nullptr;
/**
* project base directory name
......
......@@ -41,56 +41,56 @@ public:
///////
// Init
int basePeriod;
int reductionCoreCount;
int timeCoreCount;
int basePeriod = 0;
int reductionCoreCount = 0;
int timeCoreCount = 0;
/////////
// System
int perfSamplingPeriod;
float floatTolerance;
int timeTolerance;
int primaryTimeHorizon;
int secondaryTimeHorizon;
int perfSamplingPeriod = 0;
float floatTolerance = 0;
int timeTolerance = 0;
int primaryTimeHorizon = 0;
int secondaryTimeHorizon = 0;
// Model
float mdlInertiaSuccessRateThreshold;
int mdlInertiaCountThreshold;
float mdlInertiaSuccessRateThreshold = 0;
int mdlInertiaCountThreshold = 0;
// Targeted Pattern Extractor
float tpxDeltaSuccessRateThreshold;
int tpxTimehorizon;
float tpxDeltaSuccessRateThreshold = 0;
int tpxTimehorizon{};
// Simulation
int minimumSimulationTimeHorizon;
int maximumSimulationTimeHorizon;
float simulationTimeHorizon;
int minimumSimulationTimeHorizon = 0;
int maximumSimulationTimeHorizon = 0;
float simulationTimeHorizon = 0;
////////
// Debug
bool debug;
int notificationMarkerResilience;
int goalPredictionSuccessResilience;
int debugWindows;
int traceLevels;
bool getObjects;
bool decompileObjects;
bool debug = false;
int notificationMarkerResilience = 0;
int goalPredictionSuccessResilience = 0;
int debugWindows = 0;
int traceLevels = 0;
bool getObjects = false;
bool decompileObjects = false;
QString decompilationFilePath;
bool ignoreNamedObjects;
bool ignoreNamedObjects = false;
QString objectsPath;
bool testObjects;
bool testObjects = false;
//////
// Run
int runTime;
int probeLevel;
int runTime = 0;
int probeLevel = 0;
bool getModels;
bool decompileModels;
bool ignoreNamedModels;
bool getModels = false;
bool decompileModels = false;
bool ignoreNamedModels = false;
QString modelsPath;
bool testModels;
bool testModels = false;
};
#endif // REPLICODESETTINGS_H
......@@ -70,7 +70,7 @@ private:
QAction *m_runAction;
QAction *m_stopAction;
ReplicodeConfig *m_configView;
bool m_completed;
bool m_completed = false;
};
#endif
......@@ -54,12 +54,12 @@ private:
private:
QString m_folder;
QStringList m_files;
bool m_cancelSearch;
bool m_cancelSearch = false;
bool m_recursive;
bool m_hidden;
bool m_symlinks;
bool m_binary;
bool m_recursive = false;
bool m_hidden = false;
bool m_symlinks = false;
bool m_binary = false;
QStringList m_types;
QVector<QRegExp> m_excludeList;
QElapsedTimer m_time;
......
......@@ -56,7 +56,7 @@ public:
int matches = 0;
QRegularExpression regExp;
bool useRegExp = false;
bool matchCase;
bool matchCase = false;
QString replaceStr;
int searchPlaceIndex = 0;
QString treeRootText;
......@@ -179,15 +179,15 @@ private:
void onResize(const QSize &size);
Ui::SearchDialog m_ui;
Ui::SearchDialog m_ui{};
QWidget *m_toolView;
KTextEditor::Application *m_kateApp;
SearchOpenFiles m_searchOpenFiles;
FolderFilesList m_folderFilesList;
SearchDiskFiles m_searchDiskFiles;
ReplaceMatches m_replacer;
QAction *m_matchCase;
QAction *m_useRegExp;
QAction *m_matchCase = nullptr;
QAction *m_useRegExp = nullptr;
Results *m_curResults;
bool m_searchJustOpened;
int m_projectSearchPlaceIndex;
......
......@@ -81,7 +81,7 @@ private:
QRegularExpression m_regExp;
QString m_replaceText;
bool m_cancelReplace;
bool m_cancelReplace = false;
QElapsedTimer m_progressTime;
};
......
......@@ -24,8 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QDebug>
KateSessionsService::KateSessionsService(KateSessionsEngine *engine, const QString &uuid)
: Plasma::Service()
, m_engine(engine)
: m_engine(engine)
, m_uuid(uuid)
{
setName(QStringLiteral("org.kde.plasma.katesessions"));
......
......@@ -129,7 +129,7 @@ private:
QTimer m_updateTimer;
QTimer m_currItemTimer;
int m_oldCursorLine;
int m_oldCursorLine = 0;
void updatePixmapScroll();
......
......@@ -24,8 +24,7 @@
#include <QDebug>
#include <QKeyEvent>
TabSwitcherTreeView::TabSwitcherTreeView()
: QTreeView()
TabSwitcherTreeView::TabSwitcherTreeView()
{
setWindowFlags(Qt::Popup | Qt::FramelessWindowHint);
setSelectionBehavior(QAbstractItemView::SelectRows);
......
......@@ -77,7 +77,7 @@ public:
public:
detail::TabswitcherFilesModel model;
QTreeView *treeview1;
QTreeView *treeview1 = nullptr;
};
TsTestApp::TsTestApp(QWidget *parent)
......
......@@ -103,7 +103,6 @@ QObject *PluginKateXMLCheck::createView(KTextEditor::MainWindow *mainWindow)
//---------------------------------
PluginKateXMLCheckView::PluginKateXMLCheckView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *mainwin)
: QObject(mainwin)
, KXMLGUIClient()
, m_mainWindow(mainwin)
{
KXMLGUIClient::setComponentName(QStringLiteral("katexmlcheck"), i18n("Kate XML check")); // where i18n resources?
......
......@@ -61,8 +61,8 @@ public Q_SLOTS:
private:
QTemporaryFile *m_tmp_file;
KParts::ReadOnlyPart *part;
bool m_validating;
KParts::ReadOnlyPart *part = nullptr;
bool m_validating = false;
QProcess m_proc;
QString m_proc_stderr;
QString m_dtdname;
......
......@@ -112,7 +112,6 @@ QObject *PluginKateXMLTools::createView(KTextEditor::MainWindow *mainWindow)
PluginKateXMLToolsView::PluginKateXMLToolsView(KTextEditor::MainWindow *mainWin)
: QObject(mainWin)
, KXMLGUIClient()
, m_mainWindow(mainWin)
, m_model(this)
{
......
......@@ -128,7 +128,7 @@ protected:
int m_correctPos;
// code completion stuff:
KTextEditor::CodeCompletionInterface *m_codeInterface;
KTextEditor::CodeCompletionInterface *m_codeInterface = nullptr;
/// maps KTE::Document -> DTD
QHash<KTextEditor::Document *, PseudoDTD *> m_docDtds;
......
......@@ -46,8 +46,7 @@ private:
};
KatePluginListItem::KatePluginListItem(bool checked, KatePluginInfo *info)
: QTreeWidgetItem()
, mInfo(info)
: mInfo(info)
{
setCheckState(0, checked ? Qt::Checked : Qt::Unchecked);
}
......
......@@ -541,35 +541,35 @@ private:
/**
* Notify about file modifications from other processes?
*/
bool m_modNotification;
bool m_modNotification = false;
/**
* Shutdown Kate after last file is closed
*/
bool m_modCloseAfterLast;
bool m_modCloseAfterLast = false;
/**
* stacked widget containing the central area, aka view manager, quickopen, ...
*/
QStackedWidget *m_mainStackedWidget;
QStackedWidget *m_mainStackedWidget = nullptr;
/**
* quick open to fast switch documents
*/
KateQuickOpen *m_quickOpen;
KateQuickOpen *m_quickOpen = nullptr;
/**
* keeps track of views
*/
KateViewManager *m_viewManager;