From 72241ef4a62678ccc515cdf492380ce4d480203a Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Tue, 3 Jul 2007 09:14:21 +0000 Subject: [PATCH] * Comment out many debugging messages * Experimental optimization, disable kerning since this is not required with the mono-spaced fonts which are used in the terminal. svn path=/trunk/KDE/kdebase/apps/konsole/; revision=682702 --- src/BookmarkHandler.cpp | 2 +- src/ColorScheme.cpp | 20 ++++++++++---------- src/ColorSchemeEditor.cpp | 4 ++-- src/EditProfileDialog.cpp | 4 ++-- src/Filter.cpp | 2 +- src/KeyBindingEditor.cpp | 2 +- src/KeyboardTranslator.cpp | 12 ++++++------ src/Profile.cpp | 2 +- src/Pty.cpp | 4 ++-- src/SessionController.cpp | 2 +- src/SessionManager.cpp | 10 +++++----- src/TerminalDisplay.cpp | 11 ++++++++--- src/ViewContainer.cpp | 2 ++ src/ViewManager.cpp | 4 ++-- 14 files changed, 44 insertions(+), 37 deletions(-) diff --git a/src/BookmarkHandler.cpp b/src/BookmarkHandler.cpp index 3c64a527a..84f5addd0 100644 --- a/src/BookmarkHandler.cpp +++ b/src/BookmarkHandler.cpp @@ -161,7 +161,7 @@ QList > BookmarkHandler::currentBookmarkList() const void BookmarkHandler::setViews(const QList& views) { - qDebug() << "BookmarkHandler - View list changed."; + //qDebug() << "BookmarkHandler - View list changed."; m_views = views; } QList BookmarkHandler::views() const diff --git a/src/ColorScheme.cpp b/src/ColorScheme.cpp index a0a51a193..710f6d767 100644 --- a/src/ColorScheme.cpp +++ b/src/ColorScheme.cpp @@ -417,8 +417,8 @@ void ColorSchemeManager::loadAllColorSchemes() failed++; } - if ( success > 0 ) - qDebug() << "succeeded to load " << success << " color schemes."; + // if ( success > 0 ) + // qDebug() << "succeeded to load " << success << " color schemes."; if ( failed > 0 ) qDebug() << "failed to load " << failed << " color schemes."; @@ -435,7 +435,7 @@ QList ColorSchemeManager::allColorSchemes() } bool ColorSchemeManager::loadKDE3ColorScheme(const QString& filePath) { - qDebug() << "loading KDE 3 format color scheme from " << filePath; + //qDebug() << "loading KDE 3 format color scheme from " << filePath; QFile file(filePath); if (!filePath.endsWith(".schema") || !file.open(QIODevice::ReadOnly)) @@ -448,13 +448,13 @@ bool ColorSchemeManager::loadKDE3ColorScheme(const QString& filePath) Q_ASSERT( !scheme->name().isEmpty() ); - qDebug() << "found KDE 3 format color scheme - " << scheme->name(); + //qDebug() << "found KDE 3 format color scheme - " << scheme->name(); QFileInfo info(filePath); if ( !_colorSchemes.contains(info.baseName()) ) { - qDebug() << "added color scheme - " << info.baseName(); + //qDebug() << "added color scheme - " << info.baseName(); _colorSchemes.insert(scheme->name(),scheme); } @@ -484,7 +484,7 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath) QFileInfo info(filePath); - qDebug() << "loading KDE 4 native color scheme from " << filePath; + //qDebug() << "loading KDE 4 native color scheme from " << filePath; KConfig config(filePath , KConfig::NoGlobals); ColorScheme* scheme = new ColorScheme(); scheme->setName(info.baseName()); @@ -492,12 +492,12 @@ bool ColorSchemeManager::loadColorScheme(const QString& filePath) Q_ASSERT( !scheme->name().isEmpty() ); - qDebug() << "found KDE 4 native color scheme - " << scheme->name(); - qDebug() << "opacity - " << scheme->opacity(); + //qDebug() << "found KDE 4 native color scheme - " << scheme->name(); + //qDebug() << "opacity - " << scheme->opacity(); if ( !_colorSchemes.contains(info.baseName()) ) { - qDebug() << "added color scheme - " << info.baseName(); + //qDebug() << "added color scheme - " << info.baseName(); _colorSchemes.insert(scheme->name(),scheme); } @@ -555,7 +555,7 @@ QString ColorSchemeManager::findColorSchemePath(const QString& name) const } const ColorScheme* ColorSchemeManager::findColorScheme(const QString& name) { - qDebug() << "looking for color scheme - " << name; + //qDebug() << "looking for color scheme - " << name; if ( name.isEmpty() ) return defaultColorScheme(); diff --git a/src/ColorSchemeEditor.cpp b/src/ColorSchemeEditor.cpp index 422fd5588..7fce4a96c 100644 --- a/src/ColorSchemeEditor.cpp +++ b/src/ColorSchemeEditor.cpp @@ -153,7 +153,7 @@ void ColorSchemeEditor::setTransparencyPercentLabel(int percent) qreal opacity = ( 100.0 - percent ) / 100.0; _colors->setOpacity(opacity); - qDebug() << "set opacity to:" << opacity; + //qDebug() << "set opacity to:" << opacity; } void ColorSchemeEditor::setup(const ColorScheme* scheme) { @@ -169,7 +169,7 @@ void ColorSchemeEditor::setup(const ColorScheme* scheme) setupColorTable(_colors); // setup transparency slider - qDebug() << "read opacity: " << _colors->opacity(); + //qDebug() << "read opacity: " << _colors->opacity(); const int transparencyPercent = (int) ( (1-_colors->opacity())*100 ); _ui->transparencySlider->setValue(transparencyPercent); diff --git a/src/EditProfileDialog.cpp b/src/EditProfileDialog.cpp index faaccd9e0..3795ed302 100644 --- a/src/EditProfileDialog.cpp +++ b/src/EditProfileDialog.cpp @@ -504,7 +504,7 @@ bool EditProfileDialog::eventFilter( QObject* watched , QEvent* event ) } void EditProfileDialog::unpreviewAll() { - qDebug() << "unpreviewing"; + //qDebug() << "unpreviewing"; QHash map; QHashIterator iter(_previewedProperties); @@ -925,7 +925,7 @@ void EditProfileDialog::toggleResizeWindow(bool enable) } void EditProfileDialog::fontSelected(const QFont& font) { - qDebug() << "font selected"; + //qDebug() << "font selected"; QSlider* slider = _ui->fontSizeSlider; _ui->fontSizeSlider->setRange( qMin(slider->minimum(),font.pointSize()) , diff --git a/src/Filter.cpp b/src/Filter.cpp index e04e930b1..15f5d5634 100644 --- a/src/Filter.cpp +++ b/src/Filter.cpp @@ -459,7 +459,7 @@ void UrlFilter::HotSpot::activate(QObject* object) if ( actionName == "copy-action" ) { - qDebug() << "Copying url to clipboard:" << url; + //qDebug() << "Copying url to clipboard:" << url; QApplication::clipboard()->setText(url); return; diff --git a/src/KeyBindingEditor.cpp b/src/KeyBindingEditor.cpp index 5709e97c2..673bbba97 100644 --- a/src/KeyBindingEditor.cpp +++ b/src/KeyBindingEditor.cpp @@ -204,7 +204,7 @@ void KeyBindingEditor::setupKeyBindingTable(const KeyboardTranslator* translator QList entries = translator->entries(); _ui->keyBindingTable->setRowCount(entries.count()); - qDebug() << "Keyboard translator has" << entries.count() << "entries."; + //qDebug() << "Keyboard translator has" << entries.count() << "entries."; for ( int row = 0 ; row < entries.count() ; row++ ) { diff --git a/src/KeyboardTranslator.cpp b/src/KeyboardTranslator.cpp index 67482a79f..00caeb309 100644 --- a/src/KeyboardTranslator.cpp +++ b/src/KeyboardTranslator.cpp @@ -56,7 +56,7 @@ void KeyboardTranslatorManager::findTranslators() "konsole/*.keytab", KStandardDirs::NoDuplicates); - qDebug() << __FUNCTION__ << ": found " << list.count() << " keyboard translators."; + //qDebug() << __FUNCTION__ << ": found " << list.count() << " keyboard translators."; // add the name of each translator to the list and associated // the name with a null pointer to indicate that the translator @@ -68,20 +68,20 @@ void KeyboardTranslatorManager::findTranslators() QString name = QFileInfo(translatorPath).baseName(); - qDebug() << "Found translator: " << translatorPath << " with name = " << name; + //qDebug() << "Found translator: " << translatorPath << " with name = " << name; if ( !_translators.contains(name) ) _translators.insert(name,0); } - qDebug() << "Loaded translators: " << _translators.count(); + //qDebug() << "Loaded translators: " << _translators.count(); _haveLoadedAll = true; } const KeyboardTranslator* KeyboardTranslatorManager::findTranslator(const QString& name) { - qDebug() << "Finding translator: " << name; + //qDebug() << "Finding translator: " << name; if ( _translators.contains(name) && _translators[name] != 0 ) return _translators[name]; @@ -90,7 +90,7 @@ const KeyboardTranslator* KeyboardTranslatorManager::findTranslator(const QStrin if ( translator != 0 ) _translators[name] = translator; - else + else if ( !name.isEmpty() ) qWarning() << "Unable to load translator" << name; return translator; @@ -132,7 +132,7 @@ KeyboardTranslator* KeyboardTranslatorManager::loadTranslator(const QString& nam const QString& path = findTranslatorPath(name); QFile source(path); - if (!source.open(QIODevice::ReadOnly | QIODevice::Text)) + if (name.isEmpty() || !source.open(QIODevice::ReadOnly | QIODevice::Text)) return 0; KeyboardTranslator* translator = new KeyboardTranslator(name); diff --git a/src/Profile.cpp b/src/Profile.cpp index 74db9369b..14c98496c 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -338,7 +338,7 @@ QStringList KDE4ProfileReader::findProfiles() } bool KDE4ProfileReader::readProfile(const QString& path , Profile* profile , QString& parentProfile) { - qDebug() << "KDE 4 Profile Reader:" << path; + //qDebug() << "KDE 4 Profile Reader:" << path; KConfig config(path,KConfig::NoGlobals); diff --git a/src/Pty.cpp b/src/Pty.cpp index 7973a1667..3a55dac36 100644 --- a/src/Pty.cpp +++ b/src/Pty.cpp @@ -118,8 +118,8 @@ void Pty::addEnvironmentVariables(const QStringList& environment) QString variable = pair.left(pos); QString value = pair.mid(pos+1); - qDebug() << "Setting environment pair" << variable << - " set to " << value; + //qDebug() << "Setting environment pair" << variable << + // " set to " << value; setEnvironment(variable,value); } diff --git a/src/SessionController.cpp b/src/SessionController.cpp index b4d9a9bed..32abfb0d1 100644 --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -143,7 +143,7 @@ void SessionController::requireUrlFilterUpdate() } void SessionController::snapshot() { - qDebug() << "session" << _session->title(Session::NameRole) << "snapshot"; + //qDebug() << "session" << _session->title(Session::NameRole) << "snapshot"; ProcessInfo* process = 0; diff --git a/src/SessionManager.cpp b/src/SessionManager.cpp index 5b4be888a..b018bfe9a 100644 --- a/src/SessionManager.cpp +++ b/src/SessionManager.cpp @@ -140,7 +140,7 @@ QString SessionManager::loadProfile(const QString& shortPath) if ( !parentProfile.isEmpty() ) { - qDebug() << "Loading parent profile" << parentProfile; + //qDebug() << "Loading parent profile" << parentProfile; QString parentKey = loadProfile(parentProfile); newProfile->setParent(profile(parentKey)); @@ -258,7 +258,7 @@ void SessionManager::sessionTerminated(QObject* sessionObject) { Session* session = qobject_cast(sessionObject); - qDebug() << "Session finished: " << session->title(Session::NameRole); + //qDebug() << "Session finished: " << session->title(Session::NameRole); Q_ASSERT( session ); @@ -601,14 +601,14 @@ void SessionManager::loadFavorites() KSharedConfigPtr appConfig = KGlobal::config(); KConfigGroup favoriteGroup = appConfig->group("Favorite Profiles"); - qDebug() << "loading favorites"; + //qDebug() << "loading favorites"; if ( favoriteGroup.hasKey("Favorites") ) { - qDebug() << "found favorites key"; + // qDebug() << "found favorites key"; QStringList list = favoriteGroup.readEntry("Favorites",QStringList()); - qDebug() << "found " << list.count() << "entries"; + //qDebug() << "found " << list.count() << "entries"; QSet favoriteSet = QSet::fromList(list); diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index f4d6e9ea3..96dd86713 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -216,7 +216,12 @@ void TerminalDisplay::setVTFont(const QFont& f) { if (!s_antialias) font.setStyleStrategy( QFont::NoAntialias ); - + + // experimental optimization. Konsole assumes that the terminal is using a + // mono-spaced font, in which case kerning information should have an effect. + // Disabling kerning saves some computation when rendering text. + font.setKerning(false); + QFrame::setFont(font); fontChange(font); } @@ -783,11 +788,11 @@ void TerminalDisplay::processFilters() _filterChain->setImage(_image,_lines,_columns); - qDebug() << "Setup filters in" << t.elapsed() << "ms."; + //qDebug() << "Setup filters in" << t.elapsed() << "ms."; _filterChain->process(); - qDebug() << "Processed filters in" << t.elapsed() << "ms."; + //qDebug() << "Processed filters in" << t.elapsed() << "ms."; } void TerminalDisplay::updateImage() diff --git a/src/ViewContainer.cpp b/src/ViewContainer.cpp index da900da2f..62f910538 100644 --- a/src/ViewContainer.cpp +++ b/src/ViewContainer.cpp @@ -66,12 +66,14 @@ void ViewContainer::setNavigationDisplayMode(NavigationDisplayMode mode) { _navigationDisplayMode = mode; +#if 0 if ( mode == AlwaysShowNavigation ) qDebug() << "Always show nav"; else if ( mode == AlwaysHideNavigation ) qDebug() << "Always hide nav"; else if ( mode == ShowNavigationAsNeeded ) qDebug() << "Show nav as needed"; +#endif navigationDisplayModeChanged(mode); } diff --git a/src/ViewManager.cpp b/src/ViewManager.cpp index 9f72c9b02..7eda57e20 100644 --- a/src/ViewManager.cpp +++ b/src/ViewManager.cpp @@ -489,7 +489,7 @@ ViewContainer* ViewManager::createContainer(const QString& profileKey) void ViewManager::containerViewsChanged(QObject* container) { - qDebug() << "Container views changed"; + //qDebug() << "Container views changed"; if ( container == _viewSplitter->activeContainer() ) { @@ -566,7 +566,7 @@ void ViewManager::applyProfile(TerminalDisplay* view , const QString& profileKey else if ( tabBarPosition == Profile::TabBarBottom ) container->setNavigationPosition(ViewContainer::NavigationPositionBottom); - qDebug() << __FUNCTION__ << "Using random seed:" << view->randomSeed(); + //qDebug() << __FUNCTION__ << "Using random seed:" << view->randomSeed(); // load colour scheme ColorEntry table[TABLE_COLORS];