Commit f18038fa authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Const'ify + variables were initialized in header class

parent 91841c42
......@@ -105,8 +105,7 @@ class LogDialog : public QDialog
MainWindow::MainWindow()
: KXmlGuiWindow(nullptr),
mLogDialog( nullptr )
: KXmlGuiWindow(nullptr)
{
setObjectName( QStringLiteral( "MainWindow" ) );
......
......@@ -71,7 +71,7 @@ Navigator::Navigator( View *view, QWidget *parent )
QBoxLayout *topLayout = new QVBoxLayout( this );
mSearchEdit = new KLineEdit();
mSearchEdit = new KLineEdit(this);
mSearchEdit->setPlaceholderText( i18n("Search...") );
mSearchEdit->setClearButtonEnabled(true);
topLayout->addWidget( mSearchEdit );
......
......@@ -31,8 +31,7 @@ using namespace KHC;
NavigatorAppGroupItem::NavigatorAppGroupItem( DocEntry *entry, QTreeWidget *parent,
const QString &relPath )
: NavigatorItem( entry, parent ),
mRelpath( relPath ),
mPopulated( false )
mRelpath( relPath )
{
populate();
}
......@@ -40,24 +39,21 @@ NavigatorAppGroupItem::NavigatorAppGroupItem( DocEntry *entry, QTreeWidget *pare
NavigatorAppGroupItem::NavigatorAppGroupItem( DocEntry *entry, QTreeWidgetItem *parent,
const QString &relPath )
: NavigatorItem( entry, parent ),
mRelpath( relPath ),
mPopulated( false )
mRelpath( relPath )
{
populate();
}
NavigatorAppGroupItem::NavigatorAppGroupItem( DocEntry *entry, QTreeWidget *parent,
QTreeWidgetItem *after )
: NavigatorItem( entry, parent, after ),
mPopulated( false )
: NavigatorItem( entry, parent, after )
{
populate();
}
NavigatorAppGroupItem::NavigatorAppGroupItem( DocEntry *entry, QTreeWidgetItem *parent,
QTreeWidgetItem *after )
: NavigatorItem( entry, parent, after ),
mPopulated( false )
: NavigatorItem( entry, parent, after )
{
populate();
}
......
......@@ -50,7 +50,7 @@ class NavigatorAppGroupItem : public NavigatorItem
private:
QString mRelpath;
bool mPopulated;
bool mPopulated = false;
};
}
......
......@@ -32,8 +32,7 @@ using namespace KHC;
QMap< QString,NavigatorAppItem* > NavigatorAppItem::s_menuItemsMap;
NavigatorAppItem::NavigatorAppItem( DocEntry *entry, QTreeWidgetItem *parent )
: NavigatorItem( entry, parent ),
mToc( nullptr )
: NavigatorItem( entry, parent )
{
auto iter = s_menuItemsMap.find(entry->url());
if (iter == s_menuItemsMap.end())
......@@ -44,8 +43,7 @@ NavigatorAppItem::NavigatorAppItem( DocEntry *entry, QTreeWidgetItem *parent )
NavigatorAppItem::NavigatorAppItem( DocEntry *entry, QTreeWidget *parent,
QTreeWidgetItem *after )
: NavigatorItem( entry, parent, after ),
mToc( nullptr )
: NavigatorItem( entry, parent, after )
{
auto iter = s_menuItemsMap.find(entry->url());
if (iter == s_menuItemsMap.end())
......@@ -56,8 +54,7 @@ NavigatorAppItem::NavigatorAppItem( DocEntry *entry, QTreeWidget *parent,
NavigatorAppItem::NavigatorAppItem( DocEntry *entry, QTreeWidgetItem *parent,
QTreeWidgetItem *after )
: NavigatorItem( entry, parent, after ),
mToc( nullptr )
: NavigatorItem( entry, parent, after )
{
auto iter = s_menuItemsMap.find(entry->url());
if (iter == s_menuItemsMap.end())
......
......@@ -35,7 +35,7 @@
using namespace KHC;
SearchJob::SearchJob(DocEntry *entry) : mEntry( entry ), mProcess( nullptr ), mKioJob( nullptr )
SearchJob::SearchJob(DocEntry *entry) : mEntry( entry )
{
}
......
......@@ -65,7 +65,7 @@ View::View( QWidget *parentWidget, QObject *parent, KHTMLPart::GUIProfile prof,
connect(this, &View::setWindowCaption, this, &View::setTitle);
connect( this, QOverload<const QString &, const QPoint &>::of(&View::popupMenu), this, &View::showMenu );
QString css = langLookup(QStringLiteral("kdoctools5-common/kde-default.css"));
const QString css = langLookup(QStringLiteral("kdoctools5-common/kde-default.css"));
if (!css.isEmpty())
{
QFile css_file(css);
......@@ -123,10 +123,11 @@ QString View::langLookup( const QString &fname )
// this is kind of compat hack as we install our docs in en/ but the
// default language is en_US
for (QStringList::Iterator it = langs.begin(); it != langs.end(); ++it)
for (QStringList::Iterator it = langs.begin(); it != langs.end(); ++it) {
if (*it == QLatin1String("en_US")) {
*it = QStringLiteral("en");
}
}
// look up the different languages
int ldCount = localDoc.count();
......@@ -177,7 +178,8 @@ void View::writeSearchResult( const QString &str )
void View::endSearchResult()
{
end();
if ( !mSearchResult.isEmpty() ) Q_EMIT searchResultCacheAvailable();
if ( !mSearchResult.isEmpty() )
Q_EMIT searchResultCacheAvailable();
}
void View::beginInternal( const QUrl &url )
......
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