Commit accf0761 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Use member initializer lists in constructors

parent 75a57f79
......@@ -44,9 +44,8 @@
using namespace Konsole;
Application::Application(QSharedPointer<QCommandLineParser> parser, const QStringList &customCommand) : m_parser(parser), m_customCommand(customCommand)
Application::Application(QSharedPointer<QCommandLineParser> parser, const QStringList &customCommand) : _backgroundInstance(0), m_parser(parser), m_customCommand(customCommand)
{
_backgroundInstance = 0;
}
void Application::populateCommandLineParser(QCommandLineParser *parser)
......
......@@ -44,11 +44,14 @@ BookmarkHandler::BookmarkHandler(KActionCollection* collection,
QMenu* menu,
bool toplevel,
QObject* parent)
: QObject(parent),
KBookmarkOwner(),
_menu(menu),
_toplevel(toplevel),
_activeView(0)
: QObject(parent)
, KBookmarkOwner()
, _menu(menu)
, _bookmarkMenu(0)
, _file(QString())
, _toplevel(toplevel)
, _activeView(0)
, _views(QList<ViewProperties*>())
{
setObjectName(QStringLiteral("BookmarkHandler"));
......
......@@ -160,10 +160,13 @@ QString ColorScheme::translatedColorNameForIndex(int index)
}
ColorScheme::ColorScheme()
: _description(QString())
, _name(QString())
, _table(0)
, _randomTable(0)
, _opacity(1.0)
, _wallpaper(0)
{
_table = 0;
_randomTable = 0;
_opacity = 1.0;
setWallpaper(QString());
}
......
......@@ -36,7 +36,8 @@
using namespace Konsole;
ColorSchemeManager::ColorSchemeManager()
: _haveLoadedAll(false)
: _colorSchemes(QHash<QString, const ColorScheme*>())
, _haveLoadedAll(false)
{
}
......
......@@ -168,9 +168,11 @@ void TerminalImageFilterChain::setImage(const Character* const image , int lines
decoder.end();
}
Filter::Filter() :
_linePositions(0),
_buffer(0)
Filter::Filter()
: _hotspots(QMultiHash<int, HotSpot*>())
, _hotspotList(QList<HotSpot*>())
, _linePositions(0)
, _buffer(0)
{
}
......@@ -297,6 +299,7 @@ void Filter::HotSpot::setType(Type type)
}
RegExpFilter::RegExpFilter()
: _searchText(QRegularExpression())
{
}
......
......@@ -200,13 +200,15 @@ public:
class CompactHistoryBlock
{
public:
CompactHistoryBlock() {
_blockLength = 4096 * 64; // 256kb
_head = (quint8*) mmap(0, _blockLength, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
//_head = (quint8*) malloc(_blockLength);
CompactHistoryBlock()
: _blockLength(4096 * 64) // 256kb
, _head((quint8*) mmap(0, _blockLength, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0))
, _tail(0)
, _blockStart(0)
, _allocCount(0)
{
Q_ASSERT(_head != MAP_FAILED);
_tail = _blockStart = _head;
_allocCount = 0;
}
virtual ~CompactHistoryBlock() {
......@@ -240,7 +242,8 @@ private:
class CompactHistoryBlockList
{
public:
CompactHistoryBlockList() {}
CompactHistoryBlockList()
: list(QList<CompactHistoryBlock*>()) {}
~CompactHistoryBlockList();
void* allocate(size_t size);
......
......@@ -41,6 +41,7 @@ using namespace Konsole;
KeyboardTranslatorWriter::KeyboardTranslatorWriter(QIODevice* destination)
: _destination(destination)
, _writer(0)
{
Q_ASSERT(destination && destination->isWritable());
......@@ -86,7 +87,9 @@ void KeyboardTranslatorWriter::writeEntry(const KeyboardTranslator::Entry& entry
KeyboardTranslatorReader::KeyboardTranslatorReader(QIODevice* source)
: _source(source)
, _hasNext(false)
, _description(QString())
, _nextEntry()
, _hasNext(0)
{
// read input until we find the description
while (_description.isEmpty() && !source->atEnd()) {
......@@ -412,6 +415,7 @@ KeyboardTranslator::Entry::Entry()
, _state(NoState)
, _stateMask(NoState)
, _command(NoCommand)
, _text(QByteArray())
{
}
......@@ -624,7 +628,9 @@ QString KeyboardTranslator::Entry::conditionToString() const
}
KeyboardTranslator::KeyboardTranslator(const QString& aName)
: _name(aName)
: _entries(QMultiHash<int, Entry>())
, _name(aName)
, _description(QString())
{
}
......
......@@ -35,6 +35,7 @@ using namespace Konsole;
KeyboardTranslatorManager::KeyboardTranslatorManager()
: _haveLoadedAll(false)
, _fallbackTranslator(0)
, _translators(QHash<QString, KeyboardTranslator*>())
{
_fallbackTranslator = new FallbackKeyboardTranslator();
}
......
......@@ -79,9 +79,12 @@ ProcessInfo::ProcessInfo(int aPid)
, _foregroundPid(0)
, _userId(0)
, _lastError(NoError)
, _name(QString())
, _userName(QString())
, _userHomeDir(QString())
, _currentDir(QString())
, _userNameRequired(true)
, _arguments(QVector<QString>())
{
}
......
......@@ -213,7 +213,8 @@ void Profile::useFallback()
setHidden(true);
}
Profile::Profile(Profile::Ptr parent)
: _parent(parent)
: _propertyValues(QHash<Property, QVariant>())
, _parent(parent)
, _hidden(false)
{
}
......
......@@ -675,6 +675,7 @@ private:
};
inline ProfileGroup::ProfileGroup(Profile::Ptr profileParent)
: Profile(profileParent)
, _profiles(QList<Profile::Ptr>())
{
setHidden(true);
}
......
......@@ -68,8 +68,11 @@ static void sortByNameProfileList(QList<Profile::Ptr>& list)
}
ProfileManager::ProfileManager()
: _loadedAllProfiles(false)
: _profiles(QSet<Profile::Ptr>())
, _favorites(QSet<Profile::Ptr>())
, _loadedAllProfiles(false)
, _loadedFavorites(false)
, _shortcuts(QMap<QKeySequence, ShortcutData>())
{
//load fallback profile
_fallbackProfile = Profile::Ptr(new Profile());
......
......@@ -703,7 +703,12 @@ private:
{
public:
SavedState()
: cursorColumn(0), cursorLine(0), rendition(0) {}
: cursorColumn(0)
, cursorLine(0)
, rendition(0)
, foreground(CharacterColor())
, background(CharacterColor())
{}
int cursorColumn;
int cursorLine;
......
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