Bug 238518 - strange column name "1" in file browser -> Places
Summary: strange column name "1" in file browser -> Places
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: File Browser (show other bugs)
Version: 2.3-GIT
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-22 18:44 UTC by Alexander Potashev
Modified: 2010-05-30 06:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.3.2


Attachments
screenshot (12.67 KB, image/png)
2010-05-22 18:45 UTC, Alexander Potashev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Potashev 2010-05-22 18:44:45 UTC
Version:           2.3-GIT (using 4.4.3 (KDE 4.4.3), Gentoo)
Compiler:          x86_64-pc-linux-gnu-gcc
OS:                Linux (x86_64) release 2.6.32

1. open file browser (Files, "Browse local hard drive for content")
2. click "Places"
3. you can see that the column name is "1"
Comment 1 Alexander Potashev 2010-05-22 18:45:37 UTC
Created attachment 43804 [details]
screenshot
Comment 2 Nikolaj Hald Nielsen 2010-05-29 22:49:15 UTC
commit 66a94ccb12606f12a1822f63dbd18bf34600c6bc
Author: Nikolaj Hald Nielsen <nhn@kde.org>
Date:   Sat May 29 22:43:53 2010 +0200

    Fix strange column name shown in file browser when showing "places" by
    hiding th header. This also fixes another case where using the menu to
    enable/disable columns while in the "places" view makes the view go
    blank.
    BUG: 238518

diff --git a/src/browsers/filebrowser/FileBrowser.cpp b/src/browsers/filebrowser/FileBrowser.cpp
index a6cc83e..ab7d786 100644
--- a/src/browsers/filebrowser/FileBrowser.cpp
+++ b/src/browsers/filebrowser/FileBrowser.cpp
@@ -81,7 +81,8 @@ FileBrowser::FileBrowser( const char * name, QWidget *parent )
     m_fileView = new FileView( this );
     m_fileView->setModel( m_mimeFilterProxyModel );
     m_fileView->setSortingEnabled( true );
-    
+    m_fileView->header()->setVisible( true );
+
     m_fileView->hideColumn( 3 );
     m_fileView->hideColumn( 4 );
     m_fileView->hideColumn( 5 );
@@ -162,6 +163,7 @@ FileBrowser::itemActivated( const QModelIndex &index )
         if( !placesUrl.isEmpty() )
         {
             m_fileView->setModel( m_mimeFilterProxyModel );
+            m_fileView->header()->setVisible( true );
 
             //needed to make the home folder url look nice. We cannot jsut strip all protocol headers
             //as that will break remote, trash, ...
@@ -183,6 +185,7 @@ FileBrowser::itemActivated( const QModelIndex &index )
             else
             {
                 m_fileView->setModel( m_mimeFilterProxyModel );
+                m_fileView->header()->setVisible( true );
             }
         }
 
@@ -389,6 +392,7 @@ FileBrowser::setDir( const QString &dir )
        if( m_showingPlaces )
        {
            m_fileView->setModel( m_mimeFilterProxyModel );
+           m_fileView->header()->setVisible( true );
            m_showingPlaces = false;
        }
            
@@ -440,8 +444,8 @@ FileBrowser::showPlaces()
 
     QStringList siblings;
     addAdditionalItem( new BrowserBreadcrumbItem( i18n( "Places" ), siblings, QDir::homePath(), this ) );
-
     m_fileView->setModel( m_placesModel );
+    m_fileView->header()->setVisible( false );
     m_showingPlaces = true;
 }
 
@@ -456,6 +460,7 @@ FileBrowser::setupDone( const QModelIndex & index, bool success )
         if( !placesUrl.isEmpty() )
         {
             m_fileView->setModel( m_mimeFilterProxyModel );
+            m_fileView->header()->setVisible( true );
 
             //needed to make folder urls look nice. We cannot just strip all protocol headers
             //as that will break remote, trash, ...
diff --git a/src/browsers/filebrowser/FileBrowser.h b/src/browsers/filebrowser/FileBrowser.h
index 86b57c3..9553219 100644
--- a/src/browsers/filebrowser/FileBrowser.h
+++ b/src/browsers/filebrowser/FileBrowser.h
@@ -78,7 +78,7 @@ protected slots:
     void home();
 
     /**
-     * Navigates to home directory
+     * Navigates to "places"
      */
     void showPlaces();
Comment 3 Nikolaj Hald Nielsen 2010-05-30 06:40:26 UTC
commit a37423d2a44e4929dea767ecb7c043a4becdf756
Author: Nikolaj Hald Nielsen <nhn@kde.org>
Date:   Sat May 29 22:43:53 2010 +0200

    Fix strange column name shown in file browser when showing "places" by
    hiding th header. This also fixes another case where using the menu to
    enable/disable columns while in the "places" view makes the view go
    blank.
    BUG: 238518

diff --git a/src/browsers/filebrowser/FileBrowser.cpp b/src/browsers/filebrowser/FileBrowser.cpp
index a6cc83e..ab7d786 100644
--- a/src/browsers/filebrowser/FileBrowser.cpp
+++ b/src/browsers/filebrowser/FileBrowser.cpp
@@ -81,7 +81,8 @@ FileBrowser::FileBrowser( const char * name, QWidget *parent )
     m_fileView = new FileView( this );
     m_fileView->setModel( m_mimeFilterProxyModel );
     m_fileView->setSortingEnabled( true );
-    
+    m_fileView->header()->setVisible( true );
+
     m_fileView->hideColumn( 3 );
     m_fileView->hideColumn( 4 );
     m_fileView->hideColumn( 5 );
@@ -162,6 +163,7 @@ FileBrowser::itemActivated( const QModelIndex &index )
         if( !placesUrl.isEmpty() )
         {
             m_fileView->setModel( m_mimeFilterProxyModel );
+            m_fileView->header()->setVisible( true );
 
             //needed to make the home folder url look nice. We cannot jsut strip all protocol headers
             //as that will break remote, trash, ...
@@ -183,6 +185,7 @@ FileBrowser::itemActivated( const QModelIndex &index )
             else
             {
                 m_fileView->setModel( m_mimeFilterProxyModel );
+                m_fileView->header()->setVisible( true );
             }
         }
 
@@ -389,6 +392,7 @@ FileBrowser::setDir( const QString &dir )
        if( m_showingPlaces )
        {
            m_fileView->setModel( m_mimeFilterProxyModel );
+           m_fileView->header()->setVisible( true );
            m_showingPlaces = false;
        }
            
@@ -440,8 +444,8 @@ FileBrowser::showPlaces()
 
     QStringList siblings;
     addAdditionalItem( new BrowserBreadcrumbItem( i18n( "Places" ), siblings, QDir::homePath(), this ) );
-
     m_fileView->setModel( m_placesModel );
+    m_fileView->header()->setVisible( false );
     m_showingPlaces = true;
 }
 
@@ -456,6 +460,7 @@ FileBrowser::setupDone( const QModelIndex & index, bool success )
         if( !placesUrl.isEmpty() )
         {
             m_fileView->setModel( m_mimeFilterProxyModel );
+            m_fileView->header()->setVisible( true );
 
             //needed to make folder urls look nice. We cannot just strip all protocol headers
             //as that will break remote, trash, ...
diff --git a/src/browsers/filebrowser/FileBrowser.h b/src/browsers/filebrowser/FileBrowser.h
index 86b57c3..9553219 100644
--- a/src/browsers/filebrowser/FileBrowser.h
+++ b/src/browsers/filebrowser/FileBrowser.h
@@ -78,7 +78,7 @@ protected slots:
     void home();
 
     /**
-     * Navigates to home directory
+     * Navigates to "places"
      */
     void showPlaces();