summaryrefslogtreecommitdiffabout
path: root/microkde/kglobal.cpp
Side-by-side diff
Diffstat (limited to 'microkde/kglobal.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kglobal.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/microkde/kglobal.cpp b/microkde/kglobal.cpp
index bf7e238..53edd08 100644
--- a/microkde/kglobal.cpp
+++ b/microkde/kglobal.cpp
@@ -96,12 +96,19 @@ QString KGlobal::getAppName()
{
return mAppName;
}
QString KGlobal::formatMessage ( QString mess, int maxlen )
{
//int maxlen = 80;
+ if ( maxlen == 0 ) {
+ maxlen = QApplication::desktop()->width()/10;
+ if ( maxlen > 32 )
+ maxlen = (maxlen * 3) / 4;
+ if ( maxlen > 100 )
+ maxlen = 100;
+ }
int start = 0;
int end = mess.length();
QString retVal = "";
int nl, space;
while ( (end - start) > maxlen ) {
nl = mess.find( "\n", start );