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
@@ -8243,12 +8243,57 @@ int main(int argc, char *argv[])
/* Is first parameter numeric? If so treat it as config that should be loaded. */
if (isdigit(argv[1][0])) {
only_config = atoi(argv[1]);
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) {
cp = INI_GetValue(cfg, "gammu", "gammucoding", false);
if (cp) di.coding = cp;
@@ -8302,13 +8347,13 @@ int main(int argc, char *argv[])
Print_Error(error);
}
/* We wanted to read just user specified configuration. */
if (only_config != -1) {break;}
}
-
+#endif
/* Do we have enough parameters? */
if (argc == 1 + start) {
HelpGeneral();
printmsg("Too few parameters!\n");
exit(-2);
}
diff --git a/libkcal/phoneformat.cpp b/libkcal/phoneformat.cpp
index 0bc9125..2ad1b5a 100644
--- a/libkcal/phoneformat.cpp
+++ b/libkcal/phoneformat.cpp
@@ -281,13 +281,14 @@ bool PhoneFormat::load( Calendar *calendar, Calendar *existingCal)
QString fileName;
#ifdef _WIN32_
fileName = locateLocal("data", "korganizer") + "\\tempfile.vcs";
#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;
VCalFormat vfload;
vfload.setLocalTime ( true );
if ( ! vfload.load( calendar, fileName ) )
@@ -485,13 +486,14 @@ bool PhoneFormat::save( Calendar *calendar)
// 3 save file
VCalFormat vfsave;
vfsave.setLocalTime ( true );
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;
// 5 reread data
message = i18n(" Rereading all data ... ");
status.setText ( message );