summaryrefslogtreecommitdiffstats
path: root/opensuse/core/tdelibs.old/ktip-icon-hack.diff
diff options
context:
space:
mode:
authorRobert Xu <robxu9@gmail.com>2012-03-31 14:28:06 -0400
committerRobert Xu <robxu9@gmail.com>2012-03-31 14:28:06 -0400
commit59dd46ef985a719579132efa6a9aa49bfeeae112 (patch)
tree93d8c721ff263e67aaf59e364496862872ded8fb /opensuse/core/tdelibs.old/ktip-icon-hack.diff
parentc141f0bc29b6e2eeda5ca08a043d26546a1427f9 (diff)
downloadtde-packaging-59dd46ef985a719579132efa6a9aa49bfeeae112.tar.gz
tde-packaging-59dd46ef985a719579132efa6a9aa49bfeeae112.zip
better late than never, hm...
Diffstat (limited to 'opensuse/core/tdelibs.old/ktip-icon-hack.diff')
-rw-r--r--opensuse/core/tdelibs.old/ktip-icon-hack.diff56
1 files changed, 56 insertions, 0 deletions
diff --git a/opensuse/core/tdelibs.old/ktip-icon-hack.diff b/opensuse/core/tdelibs.old/ktip-icon-hack.diff
new file mode 100644
index 000000000..4812646d1
--- /dev/null
+++ b/opensuse/core/tdelibs.old/ktip-icon-hack.diff
@@ -0,0 +1,56 @@
+Index: kdeui/ktip.cpp
+===================================================================
+--- kdeui/ktip.cpp.orig
++++ kdeui/ktip.cpp
+@@ -367,24 +367,47 @@ void KTipDialog::showMultiTip(QWidget *p
+ mInstance->raise();
+ }
+
++static QString fixTip(QString tip)
++{
++ QRegExp iconRegExp("<img src=\"(.*)\">");
++ iconRegExp.setMinimal(true);
++ if (iconRegExp.search(tip)>-1) {
++ QString iconName = iconRegExp.cap(1);
++ if (!iconName.isEmpty())
++ if (KGlobal::dirs()->findResource("icon", iconName).isEmpty())
++ tip.replace("crystalsvg","hicolor");
++ }
++
++ return tip;
++}
++
+ void KTipDialog::prevTip()
+ {
+ mDatabase->prevTip();
+- mTipText->setText(QString::fromLatin1(
++ QString currentTip = QString::fromLatin1(
+ "<qt text=\"%1\" bgcolor=\"%2\">%3</qt>")
+ .arg(mTextColor.name())
+ .arg(mBaseColor.name())
+- .arg(i18n(mDatabase->tip().utf8())));
++ .arg(i18n(mDatabase->tip().utf8()));
++
++
++ currentTip = fixTip(currentTip);
++ mTipText->setText(currentTip);
+ mTipText->setContentsPos(0, 0);
+ }
+
+ void KTipDialog::nextTip()
+ {
+ mDatabase->nextTip();
+- mTipText->setText(QString::fromLatin1("<qt text=\"%1\" bgcolor=\"%2\">%3</qt>")
++ QString currentTip = QString::fromLatin1(
++ "<qt text=\"%1\" bgcolor=\"%2\">%3</qt>")
+ .arg(mTextColor.name())
+ .arg(mBaseColor.name())
+- .arg(i18n(mDatabase->tip().utf8())));
++ .arg(i18n(mDatabase->tip().utf8()));
++
++
++ currentTip = fixTip(currentTip);
++ mTipText->setText(currentTip);
+ mTipText->setContentsPos(0, 0);
+ }
+