Revert previous commit, was incorrect
[amarok.git] / src / mydiroperator.cpp
blob41e891ff620aa6b3af61fa74ed61dd27d2ab3318
1 #include "mydiroperator.h"
3 #include "medium.h"
5 #include <KActionCollection>
6 #include <kurl.h>
8 #include <QDir>
10 MyDirOperator::MyDirOperator ( const KUrl &url, QWidget *parent, Medium *medium ) : KDirOperator( url, parent )
12 m_medium = medium;
13 // setDirLister( new MyDirLister( true ) );
14 reenableDeleteKey();
17 void
18 MyDirOperator::myHome()
20 KUrl u;
21 u.setPath( m_medium ? m_medium->mountPoint() : QDir::homePath() );
22 setUrl(u, true);
25 void
26 MyDirOperator::myCdUp()
28 //KUrl tmp( url() );
29 //tmp.cd( QString::fromLatin1(".."));
30 //cdUp();
31 KUrl tmp( url() );
32 if( m_medium && !tmp.path().startsWith( m_medium->mountPoint() ) )
33 tmp.setPath( m_medium->mountPoint() );
34 setUrl(tmp, true);
38 //BEGIN private methods
39 void
40 MyDirOperator::reenableDeleteKey()
42 KActionCollection* dirActionCollection = static_cast<KActionCollection*>(KDirOperator::child("KDirOperator::myActionCollection"));
43 if( dirActionCollection )
45 QAction* trash = dirActionCollection->action("trash");
46 if(trash)
47 trash->setEnabled(false);
50 //END private methods
51 #include "mydiroperator.moc"