View | Details | Raw Unified | Return to bug 777415
Collapse All | Expand All

(-)old/kmozillahelper//main.h (+1 lines)
Lines 47-52 Link Here
47
        bool handleGetSaveX( bool url );
47
        bool handleGetSaveX( bool url );
48
        bool handleGetDirectoryX( bool url );
48
        bool handleGetDirectoryX( bool url );
49
        bool handleOpen();
49
        bool handleOpen();
50
        bool handleReveal();
50
        bool handleRun();
51
        bool handleRun();
51
        bool handleGetDefaultFeedReader();
52
        bool handleGetDefaultFeedReader();
52
        bool handleOpenMail();
53
        bool handleOpenMail();
(-)old/kmozillahelper//main.cpp (+30 lines)
Lines 44-49 Link Here
44
#include <kshell.h>
44
#include <kshell.h>
45
#include <kstandarddirs.h>
45
#include <kstandarddirs.h>
46
#include <kwindowsystem.h>
46
#include <kwindowsystem.h>
47
#include <kprocess.h>
47
#include <stdio.h>
48
#include <stdio.h>
48
#include <unistd.h>
49
#include <unistd.h>
49
50
Lines 119-124 Link Here
119
        status = handleGetDirectoryX( true );
120
        status = handleGetDirectoryX( true );
120
    else if( command == "OPEN" )
121
    else if( command == "OPEN" )
121
        status = handleOpen();
122
        status = handleOpen();
123
    else if ( command == "REVEAL" )
124
        status = handleReveal();
122
    else if( command == "RUN" )
125
    else if( command == "RUN" )
123
        status = handleRun();
126
        status = handleRun();
124
    else if( command == "GETDEFAULTFEEDREADER" )
127
    else if( command == "GETDEFAULTFEEDREADER" )
Lines 465-470 Link Here
465
        }
468
        }
466
    }
469
    }
467
470
471
bool App::handleReveal()
472
    {
473
    if( !readArguments( 1 ))
474
        return false;
475
    QString path = getArgument();
476
    if( !allArgumentsUsed())
477
        return false;
478
    KApplication::updateUserTimestamp( 0 ); // TODO
479
    const KService::List apps = KMimeTypeTrader::self()->query("inode/directory", "Application");
480
    if (apps.size() != 0)
481
        {
482
        QString command = apps.at(0)->exec().split( " " ).first(); // only the actual command
483
        if (command == "dolphin" || command == "konqueror")
484
            {
485
            command = KStandardDirs::findExe( command );
486
            if( command.isEmpty())
487
                return false;
488
            return KProcess::startDetached(command, QStringList() << "--select" << path);
489
            }
490
        }
491
    QFileInfo info(path);
492
    QString dir = info.dir().path();
493
    (void) new KRun( KUrl(dir), NULL ); // TODO parent
494
    return true; // TODO check for errors?
495
    }
496
497
468
bool App::handleRun()
498
bool App::handleRun()
469
    {
499
    {
470
    if( !readArguments( 2 ))
500
    if( !readArguments( 2 ))

Return to bug 777415