~ubuntu-branches/ubuntu/trusty/krusader/trusty

« back to all changes in this revision

Viewing changes to krusader/Panel/panelfunc.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2009-04-04 13:47:12 UTC
  • mfrom: (1.2.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20090404134712-cjyw31gz2mxtyd3p
Tags: 2.0~svn6249-0ubuntu1
* New svn snapshot to commit 6249
  - Additional bug fixes
  - Fixes to build with Qt 4.5
* Update debian/copyright to use © instead of (c) throughouht

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
                , nameToMakeCurrent );
99
99
}
100
100
 
 
101
void ListPanelFunc::popErronousUrl() {
 
102
        KUrl current = urlStack.last();
 
103
        while( urlStack.count() != 0 )
 
104
        {
 
105
                KUrl url = urlStack.takeLast();
 
106
                if( !current.equals( url ) )
 
107
                {
 
108
                        immediateOpenUrl( url );
 
109
                        return;
 
110
                }
 
111
        }
 
112
        immediateOpenUrl( KUrl( ROOT_DIR ) );
 
113
}
 
114
 
101
115
void ListPanelFunc::immediateOpenUrl( const KUrl& urlIn ) {
102
116
        KUrl url = urlIn;
103
117
        url.cleanPath();
138
152
        }
139
153
 
140
154
        vfs* v = 0;
141
 
        if ( !urlStack.last().equals( url ) )
 
155
        if ( urlStack.count() == 0 || !urlStack.last().equals( url ) )
142
156
                urlStack.push_back( url );
143
157
        // count home many urls is in the stack, so later on, we'll know if the refresh was a success
144
158
        int stackSize = urlStack.count();
145
159
        bool refreshFailed = true; // assume the worst
146
160
        while ( true ) {
147
 
                KUrl u = urlStack.takeLast();
 
161
                KUrl u = urlStack.count() == 0 ? KUrl( ROOT_DIR ) : urlStack.takeLast();
148
162
                //u.adjustPath(KUrl::RemoveTrailingSlash); // remove trailing "/"
149
163
                u.cleanPath(); // Resolves "." and ".." components in path.
150
164
                v = KrVfsHandler::getVfs( u, panel, files() );
235
249
                        OTHER_FUNC->files() ->vfs_setQuiet( true );
236
250
                        // the trailing slash is nessesary because krusader provides Dir's without it
237
251
                        // we can't use openUrl because the delay don't allow a check if the panel has realy changed!
238
 
                        OTHER_FUNC->immediateOpenUrl( KUrl::relativeUrl( panel->virtualPath().url() + "/", url.url() ) );
 
252
                        KUrl dest = otherDir;
 
253
                        dest.addPath( KUrl::relativeUrl( panel->virtualPath().url() + "/", url.url() ) );
 
254
                        OTHER_FUNC->immediateOpenUrl( dest );
239
255
                        OTHER_FUNC->files() ->vfs_setQuiet( false );
240
256
                        // now we need to test ACTIVE_PANEL because the openURL has changed the active panel!!
241
257
                        if ( other_panel->virtualPath().equals( otherDir ) ) {
742
758
        panel->prepareToDelete();
743
759
 
744
760
        // let the vfs do the job...
745
 
        if (reallyDelete) {
746
 
                // if reallyDelete, then make sure nothing gets moved to trash
747
 
                group.writeEntry( "Move To Trash", false );
748
 
        }
749
 
        files() ->vfs_delFiles( &fileNames );
750
 
        if (reallyDelete) {
751
 
                group.writeEntry( "Move To Trash", trash);
752
 
        }
 
761
        files() ->vfs_delFiles( &fileNames, reallyDelete );
753
762
}
754
763
 
755
764
void ListPanelFunc::goInside( const QString& name )