~ubuntu-branches/ubuntu/wily/plasma-nm/wily-proposed

« back to all changes in this revision

Viewing changes to vpn/vpnc/vpnc.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell, Jonathan Riddell, Harald Sitter, Scarlett Clark
  • Date: 2014-10-01 16:14:15 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20141001161415-b3q27oqg8xqumbq7
Tags: 4:5.1.0.1-0ubuntu1
[ Jonathan Riddell ]
* New upstream release

[ Harald Sitter ]
* Drop ugly workaround to make a desktop file exectuable
  + This either should be done upstream or be lintian overridden (former
    seems more suitable). Upstream has been poked on IRC.
* Add lintian overrides
  + missing manpages: we don't care
  + package name doesn't match soname: we don't care for internal libraries
  + shlib-without-versioned-soname: we don't care for internal libraries
* Fix copyright short license for LGPL-KDEeV

[ Scarlett Clark ]
* Fix copyright short licence for LGPL-2.1-KDEeV 

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include "vpnc.h"
25
25
 
 
26
#include <QStandardPaths>
 
27
#include <QFile>
 
28
#include <QUrl>
 
29
 
26
30
#include <KPluginFactory>
27
31
#include <KSharedConfig>
28
 
#include <KStandardDirs>
29
32
#include <KMessageBox>
30
 
#include <KLocale>
31
 
#include <KDebug>
32
 
#include <KUrl>
 
33
#include <KLocalizedString>
 
34
#include <QDebug>
33
35
#include "nm-vpnc-service.h"
34
36
 
35
37
#include <NetworkManagerQt/Connection>
80
82
void VpncUiPluginPrivate::ciscoDecryptError(QProcess::ProcessError pError)
81
83
{
82
84
    if (!pError) {
83
 
        kDebug() << "Error in executing cisco-decrypt";
 
85
        qDebug() << "Error in executing cisco-decrypt";
84
86
        KMessageBox::error(0, i18n("Error decrypting the obfuscated password"), i18n("Error"), KMessageBox::Notify);
85
87
    }
86
88
    decryptedPasswd.clear();
89
91
 
90
92
#define NM_VPNC_LOCAL_PORT_DEFAULT 500
91
93
 
92
 
K_PLUGIN_FACTORY(VpncUiPluginFactory, registerPlugin<VpncUiPlugin>();)
93
 
K_EXPORT_PLUGIN(VpncUiPluginFactory("plasmanetworkmanagement_vpncui"))
 
94
K_PLUGIN_FACTORY_WITH_JSON(VpncUiPluginFactory, "plasmanetworkmanagement_vpncui.json", registerPlugin<VpncUiPlugin>();)
94
95
 
95
96
VpncUiPlugin::VpncUiPlugin(QObject * parent, const QVariantList &) : VpnUiPlugin(parent)
96
97
{
124
125
 
125
126
NMVariantMapMap VpncUiPlugin::importConnectionSettings(const QString &fileName)
126
127
{
127
 
    kDebug() << "Importing Cisco VPN connection from " << fileName;
 
128
    qDebug() << "Importing Cisco VPN connection from " << fileName;
128
129
 
129
130
    VpncUiPluginPrivate * decrPlugin = 0;
130
131
    NMVariantMapMap result;
146
147
    KConfigGroup cg(config, "main");   // Keys&Values are stored under [main]
147
148
    if (cg.exists()) {
148
149
        // Setup cisco-decrypt binary to decrypt the passwords
149
 
        const QString ciscoDecryptBinary = KStandardDirs::findExe("cisco-decrypt", QString::fromLocal8Bit(qgetenv("PATH")) + ":/usr/lib/vpnc");
 
150
        const QString ciscoDecryptBinary = QStandardPaths::findExecutable("cisco-decrypt");
150
151
        if (ciscoDecryptBinary.isEmpty()) {
151
152
            mErrorMessage = i18n("Needed executable cisco-decrypt could not be found.");
152
153
            return result;
281
282
 
282
283
        QVariantMap conn;
283
284
        if (decrPlugin->readStringKeyValue(cg,"Description").isEmpty()) {
284
 
            KUrl name = fileName;
 
285
            QUrl name = fileName;
285
286
            conn.insert("id", name.fileName().remove(QLatin1String(".pcf"), Qt::CaseInsensitive));
286
287
        } else {
287
288
            conn.insert("id", decrPlugin->readStringKeyValue(cg,"Description"));
395
396
    mError = VpncUiPlugin::NoError;
396
397
    return true;
397
398
}
 
399
 
 
400
#include "vpnc.moc"