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

« back to all changes in this revision

Viewing changes to krusader/GUI/mediabutton.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-08-08 13:47:36 UTC
  • mfrom: (1.2.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20110808134736-8e630ivgd2c3sgg5
Tags: 1:2.4.0~beta1-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *****************************************************************************/
18
18
 
19
19
#include "mediabutton.h"
20
 
#include "../krslots.h"
 
20
 
 
21
#include "../krglobal.h"
21
22
#include "../MountMan/kmountman.h"
22
23
 
23
24
#include <QMouseEvent>
71
72
 
72
73
void MediaButton::mountPointChanged(QString mp)
73
74
{
74
 
    Solid::Device device(krMtMan.findUdiForPath(mp, Solid::DeviceInterface::StorageAccess));
75
 
    Solid::StorageVolume *vol = device.as<Solid::StorageVolume> ();
76
75
    QString icon("system-file-manager");
77
 
 
78
 
    if(device.isValid())
79
 
        icon = device.icon();
80
76
    QStringList overlays;
81
 
    if (vol && vol->usage() == Solid::StorageVolume::Encrypted) {
82
 
        overlays << "security-high";
 
77
 
 
78
    if(!mp.isEmpty()) {
 
79
        Solid::Device device(krMtMan.findUdiForPath(mp, Solid::DeviceInterface::StorageAccess));
 
80
        Solid::StorageVolume *vol = device.as<Solid::StorageVolume> ();
 
81
 
 
82
        if(device.isValid())
 
83
            icon = device.icon();
 
84
        if (vol && vol->usage() == Solid::StorageVolume::Encrypted)
 
85
            overlays << "security-high";
83
86
    }
84
87
    setIcon(KIcon(icon, 0, overlays));
85
88
}
376
379
            if (result == 1)
377
380
                emit openUrl(openURL);
378
381
            else
379
 
                SLOTS->newTab(openURL);
 
382
                emit newTab(openURL);
380
383
        } else {
381
384
            mount(udi, true, result == 2);   // mount first, when mounted open the tab
382
385
        }
401
404
        QString mp = udi.mid(7);
402
405
        krMtMan.mount(mp, true);
403
406
        if (newtab)
404
 
            SLOTS->newTab(KUrl(mp));
 
407
            emit newTab(KUrl(mp));
405
408
        else
406
409
            emit openUrl(KUrl(mp));
407
410
        return;
424
427
            Solid::StorageAccess *access = Solid::Device(udi).as<Solid::StorageAccess>();
425
428
            if (access && access->isAccessible()) {
426
429
                if (openInNewTab)
427
 
                    SLOTS->newTab(KUrl(access->filePath()));
 
430
                    emit newTab(KUrl(access->filePath()));
428
431
                else
429
432
                    emit openUrl(KUrl(access->filePath()));
430
433
            }