[Amarok] Strip HTML from tooltip and do not create an empty
Dan Meltzer
parallelgrapefruit at gmail.com
Thu Aug 27 00:36:47 CEST 2009
On Wed, Aug 26, 2009 at 6:31 PM, Casper van
Donderen<casper.vandonderen at gmail.com> wrote:
> Okay,
>
> So then we force every Qt application to not use a tool tip with
> anything in between <>-symbols since the tooltip comes from plain Qt.
> That looks a bit like overkill to me.
Any one word thing with trailing spaces, between < and >.
I can't think of anything like that that wouldn't be some sort of
markup tag, and therefore not want to be seen.
>
> Casper
>
> On Thu, Aug 27, 2009 at 12:26 AM, Dan
> Meltzer<parallelgrapefruit at gmail.com> wrote:
>> On Wed, Aug 26, 2009 at 6:21 PM, Casper van
>> Donderen<casper.vandonderen at gmail.com> wrote:
>>> commit 48acb0fd3cabcf09b50f4c7c37b610c0f30aa353
>>> Author: Casper van Donderen <casper.vandonderen at gmail.com>
>>> AuthorDate: Wed Aug 26 14:49:01 2009 +0200
>>> Commit: Casper van Donderen <casper.vandonderen at gmail.com>
>>> CommitDate: Thu Aug 27 00:07:15 2009 +0200
>>>
>>> Strip HTML from tooltip and do not create an empty newline for the cover, only for Windows...
>>
>> As I said, this does not belong in Amarok. This belongs in kdelibs,
>> or whereever the ksystrayicon for windows code lives. It's something
>> that multiple applications can use, and there shouldn't be a copy in
>> every single one. Please revert this and put it in the right place.
>>>
>>> diff --git a/src/Systray.cpp b/src/Systray.cpp
>>> index 46a1687..a9341ab 100644
>>> --- a/src/Systray.cpp
>>> +++ b/src/Systray.cpp
>>> @@ -143,14 +143,16 @@ Amarok::TrayIcon::setupToolTip()
>>>
>>> // HACK: This block is inefficient and more or less stupid
>>> // (Unnecessary I/O on disk. Workaround?)
>>> - const QString tmpFilename = Amarok::saveLocation() + "tooltipcover.png";
>>> - if( m_track->album() )
>>> - {
>>> - const QPixmap image = m_track->album()->imageWithBorder( 100, 5 );
>>> - image.save( tmpFilename, "PNG" );
>>> - tooltip += "<tr><td width='10' align='left' valign='bottom' rowspan='9'>";
>>> - tooltip += "<img src='"+tmpFilename+"' /></td></tr>";
>>> - }
>>> + #ifndef Q_WS_WIN
>>> + const QString tmpFilename = Amarok::saveLocation() + "tooltipcover.png";
>>> + if( m_track->album() )
>>> + {
>>> + const QPixmap image = m_track->album()->imageWithBorder( 100, 5 );
>>> + image.save( tmpFilename, "PNG" );
>>> + tooltip += "<tr><td width='10' align='left' valign='bottom' rowspan='9'>";
>>> + tooltip += "<img src='"+tmpFilename+"' /></td></tr>";
>>> + }
>>> + #endif
>>>
>>> QStringList left, right;
>>>
>>> @@ -212,6 +214,11 @@ Amarok::TrayIcon::setupToolTip()
>>>
>>> tooltip += "</table>";
>>>
>>> + #ifdef Q_WS_WIN
>>> + tooltip.replace( "<tr>", "\n" );
>>> + QRegExp rx( "(<[^>]+>)" );
>>> + tooltip.replace( rx, "" );
>>> + #endif
>>> setToolTip( tooltip );
>>> }
>>> else
>>>
>>>
>>>
>> _______________________________________________
>> Amarok-devel mailing list
>> Amarok-devel at kde.org
>> https://mail.kde.org/mailman/listinfo/amarok-devel
>>
> _______________________________________________
> Amarok-devel mailing list
> Amarok-devel at kde.org
> https://mail.kde.org/mailman/listinfo/amarok-devel
>
More information about the Amarok-devel
mailing list