]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/recents.cpp
Revert "Qt: add events extender"
[vlc] / modules / gui / qt4 / recents.cpp
old mode 100644 (file)
new mode 100755 (executable)
index dd4c57d..12a892c
@@ -31,7 +31,6 @@
 #include <QSettings>
 #include <QRegExp>
 #include <QSignalMapper>
-#include <QFontMetrics>
 
 #ifdef WIN32
     #include <shlobj.h>
@@ -43,7 +42,7 @@
         SHARD_APPIDINFOIDLIST   = 0x00000005,
         SHARD_LINK              = 0x00000006,
         SHARD_APPIDINFOLINK     = 0x00000007,
-        SHARD_SHELLITEM         = 0x00000008
+        SHARD_SHELLITEM         = 0x00000008 
     } SHARD; */
     #define SHARD_PATHW 0x00000003
 #endif
@@ -89,11 +88,15 @@ void RecentsMRL::addRecent( const QString &mrl )
 
 #ifdef WIN32
     /* Add to the Windows 7 default list in taskbar */
-    SHAddToRecentDocs( SHARD_PATHW, qtu( mrl ) );
+    char* path = make_path( qtu( mrl ) );
+    if( path )
+    {
+        SHAddToRecentDocs( SHARD_PATHW, mrl.utf16() );
+        free( path );
+    }
 #endif
-    QString mrl2 = QApplication::fontMetrics().elidedText( mrl, Qt::ElideLeft, 400 );
 
-    int i_index = stack->indexOf( mrl2 );
+    int i_index = stack->indexOf( mrl );
     if( 0 <= i_index )
     {
         /* move to the front */
@@ -101,11 +104,11 @@ void RecentsMRL::addRecent( const QString &mrl )
     }
     else
     {
-        stack->prepend( mrl2 );
-        if( stack->size() > RECENTS_LIST_SIZE )
+        stack->prepend( mrl );
+        if( stack->count() > RECENTS_LIST_SIZE )
             stack->takeLast();
     }
-    QVLCMenu::updateRecents( p_intf );
+    VLCMenuBar::updateRecents( p_intf );
     save();
 }
 
@@ -115,7 +118,7 @@ void RecentsMRL::clear()
         return;
 
     stack->clear();
-    if( isActive ) QVLCMenu::updateRecents( p_intf );
+    if( isActive ) VLCMenuBar::updateRecents( p_intf );
     save();
 }
 
@@ -130,7 +133,7 @@ void RecentsMRL::load()
     QStringList list = getSettings()->value( "RecentsMRL/list" ).toStringList();
 
     /* And filter the regexp on the list */
-    for( int i = 0; i < list.size(); ++i )
+    for( int i = 0; i < list.count(); ++i )
     {
         if ( !filter || filter->indexIn( list.at(i) ) == -1 )
             stack->append( list.at(i) );