summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/phoneaccess.cpp24
-rw-r--r--libkdepim/phoneaccess.h2
2 files changed, 25 insertions, 1 deletions
diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp
index fe914dd..5fafa1f 100644
--- a/libkdepim/phoneaccess.cpp
+++ b/libkdepim/phoneaccess.cpp
@@ -122,30 +122,52 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model
122 QTextStream ts( &file ); 122 QTextStream ts( &file );
123 ts << content ; 123 ts << content ;
124 file.close(); 124 file.close();
125 } 125 }
126 126
127} 127}
128 128
129 129
130bool PhoneAccess::writeToPhone( QString fileName) 130bool PhoneAccess::writeToPhone( QString fileName)
131{ 131{
132 132
133#ifdef DESKTOP_VERSION 133#ifdef DESKTOP_VERSION
134#ifdef _WIN32_ 134#ifdef _WIN32_
135 QString command ="kammu --restore " + fileName ; 135 QString command ="kammu --restore " + fileName ;
136#else 136#else
137 QString command ="./kammu --restore " + fileName ; 137 QString command ="./kammu --restore " + fileName ;
138#endif 138#endif
139#else 139#else
140 QString command ="kammu --restore " + fileName ; 140 QString command ="kammu --restore " + fileName ;
141#endif 141#endif
142 int ret; 142 int ret;
143 while ( (ret = system ( command.latin1())) != 0 ) { 143 while ( (ret = system ( command.latin1())) != 0 ) {
144 qDebug("Error S::command returned %d.", ret); 144 qDebug("Error S::command returned %d.", ret);
145 int retval = KMessageBox::warningContinueCancel(0, 145 int retval = KMessageBox::warningContinueCancel(0,
146 i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KO/Pi phone access"),i18n("Retry"),i18n("Cancel")); 146 i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KDE/Pim phone access"),i18n("Retry"),i18n("Cancel"));
147 if ( retval != KMessageBox::Continue )
148 return false;
149 }
150 return true;
151}
152bool PhoneAccess::readFromPhone( QString fileName)
153{
154
155#ifdef DESKTOP_VERSION
156#ifdef _WIN32_
157 QString command ="kammu --backup " + fileName + " -yes" ;
158#else
159 QString command ="./kammu --backup " + fileName + " -yes" ;
160#endif
161#else
162 QString command ="kammu --backup " + fileName + " -yes" ;
163#endif
164 int ret;
165 while ( (ret = system ( command.latin1())) != 0 ) {
166 qDebug("Error S::command returned %d.", ret);
167 int retval = KMessageBox::warningContinueCancel(0,
168 i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KDE/Pim phone access"),i18n("Retry"),i18n("Cancel"));
147 if ( retval != KMessageBox::Continue ) 169 if ( retval != KMessageBox::Continue )
148 return false; 170 return false;
149 } 171 }
150 return true; 172 return true;
151} 173}
diff --git a/libkdepim/phoneaccess.h b/libkdepim/phoneaccess.h
index b7c4732..80840e2 100644
--- a/libkdepim/phoneaccess.h
+++ b/libkdepim/phoneaccess.h
@@ -1,42 +1,44 @@
1/* 1/*
2 This file is part of libkcal. 2 This file is part of libkcal.
3 3
4 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public 7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either 8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version. 9 version 2 of the License, or (at your option) any later version.
10 10
11 This library is distributed in the hope that it will be useful, 11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21#ifndef PHONEACCESS_H 21#ifndef PHONEACCESS_H
22#define PHONEACCESS_H 22#define PHONEACCESS_H
23 23
24#include <qstring.h> 24#include <qstring.h>
25#include <qobject.h>
25 26
26 27
27 28
28/** 29/**
29 This class implements the calendar format used by Phone. 30 This class implements the calendar format used by Phone.
30*/ 31*/
31 32
32class PhoneAccess : public QObject { 33class PhoneAccess : public QObject {
33 public: 34 public:
34 35
35 static void writeConfig( QString device,QString connection, QString model ); 36 static void writeConfig( QString device,QString connection, QString model );
36 static bool writeToPhone( QString fileName ); 37 static bool writeToPhone( QString fileName );
38 static bool readFromPhone( QString fileName );
37 39
38}; 40};
39 41
40 42
41 43
42#endif 44#endif