summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--gammu/emb/gammu/gammu.c47
-rw-r--r--libkcal/phoneformat.cpp6
2 files changed, 50 insertions, 3 deletions
diff --git a/gammu/emb/gammu/gammu.c b/gammu/emb/gammu/gammu.c
index 1d53fb0..5163d81 100644
--- a/gammu/emb/gammu/gammu.c
+++ b/gammu/emb/gammu/gammu.c
@@ -8246,6 +8246,51 @@ int main(int argc, char *argv[])
if (only_config >= 0) start++; else only_config = -1;
}
+ GSM_ReadConfig(NULL, &s.Config[0], 0);
+ s.ConfigNum = 1;
+ GSM_Config *con = &s.Config[0];
+
+ char* tempC;
+ tempC = argv[argc-1]+2;
+ if ( *tempC != 0 ) {
+ fprintf(stderr,"Using model %s \n",tempC);
+ strcpy(con->Model,tempC );
+ }
+ tempC = argv[argc-2]+2;
+ if ( *tempC != 0 ) {
+ fprintf(stderr,"Using device %s \n",tempC);
+ con->Device = strdup(tempC);
+ con->DefaultDevice = false;
+ }
+ tempC = argv[argc-3]+2;
+ if ( *tempC != 0 ) {
+ fprintf(stderr,"Using connection %s \n",tempC);
+ con->Connection = strdup(tempC);
+ con->DefaultConnection = false;
+ }
+ argc = argc-3;
+#if 0
+ if ( ! mConnection.isEmpty() ) {
+ cfg->Connection = strdup(mConnection.latin1());
+ cfg->DefaultConnection = false;
+ qDebug("Connection set %s ", cfg->Connection );
+
+ }
+ if ( ! mDevice.isEmpty() ) {
+ cfg->Device = strdup(mDevice.latin1());
+ cfg->DefaultDevice = false;
+ qDebug("Device set %s ", cfg->Device);
+
+ }
+ if ( ! mModel.isEmpty() ) {
+ strcpy(cfg->Model,mModel.latin1() );
+ cfg->DefaultModel = false;
+ qDebug("Model set %s ",cfg->Model );
+ }
+
+#endif
+
+#if 0
cfg=GSM_FindGammuRC();
for (i = 0; i <= MAX_CONFIG_NUM; i++) {
if (cfg!=NULL) {
@@ -8305,7 +8350,7 @@ int main(int argc, char *argv[])
/* We wanted to read just user specified configuration. */
if (only_config != -1) {break;}
}
-
+#endif
/* Do we have enough parameters? */
if (argc == 1 + start) {
HelpGeneral();
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp
index 0bc9125..2ad1b5a 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -284,7 +284,8 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
#else
fileName = "/tmp/kdepimtemp.vcs";
#endif
- QString command ="./kammu --backup " + fileName + " -yes";
+ QString command ="./kammu --backup " + fileName + " -yes -C" +
+ mConnection +" -D" + mDevice +" -M" + mModel;
int ret = system ( command.latin1() );
if ( ret != 0 )
return false;
@@ -488,7 +489,8 @@ bool PhoneFormat::save( Calendar *calendar)
if ( ! vfsave.save( calendar, fileName ) )
return false;
// 4 call kammu
- QString command ="./kammu --restore " + fileName ;
+ QString command ="./kammu --restore " + fileName + " -C" +
+ mConnection +" -D" + mDevice +" -M" + mModel;;
int ret = system ( command.latin1() );
if ( ret != 0 )
return false;