diff --git a/tabbox.cpp b/tabbox.cpp index d231cb60c0..8600dd958a 100644 --- a/tabbox.cpp +++ b/tabbox.cpp @@ -211,7 +211,6 @@ void TabBox::paintContents() if ( currentClient() ) { QString s; if (!client->isOnDesktop(workspace()->currentDesktop())){ -//### s = KWM::desktopName(client->desktop()); s.append(": "); } @@ -253,7 +252,7 @@ void TabBox::paintContents() } } } else { // DesktopMode - p.drawText( r, AlignCenter, QString::number( desk ) ); + p.drawText( r, AlignCenter, workspace()->desktopName(desk) ); int x = (width() - workspace()->numberOfDesktops() * 20 )/2; int y = height() - 26; QFont f( font() ); @@ -292,7 +291,7 @@ void TabBox::delayedShow() KConfig * c(KGlobal::config()); c->setGroup("TabBox"); bool delay = c->readNumEntry("ShowDelay", false); - + if (!delay) { show(); return; diff --git a/workspace.cpp b/workspace.cpp index b0ee9979b0..0a04183c39 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -76,6 +76,10 @@ private: }; +QString Workspace::desktopName( int desk ) +{ + return QString::fromUtf8( rootInfo->desktopName( desk ) ); +} extern Time kwin_time; extern void kwin_updateTime(); @@ -1033,7 +1037,7 @@ void Workspace::requestFocus( Client* c) { if (!focusChangeEnabled()) return; - + //TODO will be different for non-root clients. (subclassing?) if ( !c ) { focusToNull(); @@ -2087,7 +2091,7 @@ void Workspace::desktopPopupAboutToShow() desk_popup->insertSeparator( -1 ); int id; for ( int i = 1; i <= numberOfDesktops(); i++ ) { - id = desk_popup->insertItem( QString("&%1 %2").arg(i).arg(rootInfo->desktopName(i)), i ); + id = desk_popup->insertItem( QString("&%1 %2").arg(i).arg( desktopName(i) ) ); if ( popup_client && !popup_client->isSticky() && popup_client->desktop() == i ) desk_popup->setItemChecked( id, TRUE ); } @@ -2662,7 +2666,7 @@ void Workspace::saveDesktopSettings() c.setGroup("Desktops"); c.writeEntry("Number", number_of_desktops ); for(int i = 1; i <= number_of_desktops; i++) { - QString s = QString::fromUtf8( rootInfo->desktopName( i ) ); + QString s = desktopName( i ); if ( s.isEmpty() ) { s = i18n("Desktop %1").arg(i); rootInfo->setDesktopName( i, s.utf8().data() ); diff --git a/workspace.h b/workspace.h index 6f1c4c17a8..82cc90131c 100644 --- a/workspace.h +++ b/workspace.h @@ -174,7 +174,8 @@ public: void cascadeDesktop(); void unclutterDesktop(); void reconfigure(); - + + QString desktopName( int desk ); public slots: void setCurrentDesktop( int new_desktop ); @@ -257,7 +258,7 @@ private: // desktop names and number of desktops void loadDesktopSettings(); void saveDesktopSettings(); - + // mouse emulation WId getMouseEmulationWindow(); enum MouseEmulation { EmuPress, EmuRelease, EmuMove };