~ubuntu-branches/ubuntu/vivid/kvpnc/vivid-proposed

« back to all changes in this revision

Viewing changes to src/ciscopasswddecoder.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2009-04-23 09:18:50 UTC
  • mfrom: (1.1.10 upstream) (8.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090423091850-hweeg0jo64t0jx52
Tags: 0.9.1-1
* New upstream release (KDE4 is here)
* Add Build-Depends cmake and pkg-kde-tools
* Remove obsolete debian/patches
* Refresh debian/patches:
  - 10_su-to-root_usage.diff
  - 13_add_kuser_issuperuser.diff
* Cleanup debian/rules - simple under KDE4
* Update debian/watch for KDE4 version
* Update debian/copyright - use versionned licenses
* Update Section field - move to utils
* Remove obsolete dependencies: kdebase-bin, gksu, sux and modutils
* Update debian/kvpnc.{manpages,1}

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 �***************************************************************************/
21
21
#include "ciscopasswddecoder.h"
22
22
 
23
 
#include <qfile.h>
24
 
#include <qtextstream.h>
 
23
#include <QtCore/qfile.h>
 
24
#include <Qt3Support/q3textstream.h>
25
25
#include <kmessagebox.h>
26
26
#include <klocale.h>
27
27
 
37
37
void CiscoPasswdDecoder::readProfileData(QString& profile, QString& userData, QString& groupData)
38
38
{
39
39
        QFile PcfFile(profile);
40
 
        QTextStream stream ( &PcfFile );
 
40
        Q3TextStream stream ( &PcfFile );
41
41
 
42
 
        if ( PcfFile.open(IO_ReadOnly))
 
42
        if ( PcfFile.open(QIODevice::ReadOnly))
43
43
        {
44
44
                QString line = "";
45
45
                while ( !stream.atEnd() )
48
48
                        if ( !line.startsWith("#") )
49
49
                        {
50
50
                                if (line.startsWith("enc_GroupPwd") || line.startsWith("enc_GroupPwd") )
51
 
                                        groupData=line.section('=',1,1).stripWhiteSpace();
 
51
                                        groupData=line.section('=',1,1).trimmed();
52
52
                                if (line.startsWith("enc_UserPassword") || line.startsWith("enc_GroupPwd") )
53
 
                                        userData=line.section('=',1,1).stripWhiteSpace();
 
53
                                        userData=line.section('=',1,1).trimmed();
54
54
                        }
55
55
                }
56
56
                PcfFile.close();
57
57
        }
58
58
        else
59
59
        {
60
 
                KMessageBox::error ( 0, i18n ( "Reading of \"%1\" has been failed!" ).arg ( PcfFile.name() ) );
 
60
                KMessageBox::error ( 0, i18n ( "Reading of \"%1\" has been failed!" ,   PcfFile.name() ) );
61
61
        }
62
62
}
63
63