~ubuntu-branches/debian/sid/gnote/sid

« back to all changes in this revision

Viewing changes to src/addins/stickynoteimport/stickynoteimportnoteaddin.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Vincent Cheng
  • Date: 2011-07-30 16:48:32 UTC
  • mfrom: (1.3.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110730164832-u2xq6ywe0aduil1r
Tags: 0.7.5-1
* New upstream release.
* Remove "Provides: tomboy" from debian/control. (Closes: #627347)
* Update debian/rules to dh 7 "rules.tiny" style.
  - Drop cdbs from build dependencies.
* Really update Standards version from 3.9.1 to 3.9.2, no updates required.
* Update debhelper compatiblity level from 7 to 8.
* Add Vcs-* fields to debian/control.
* Update debian/copyright to fully conform with DEP-5.
* Remove unneeded debian/fdl-1.2.txt; a copy of the GFDL can be found in
  /usr/share/common-licenses/GFDL-1.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * gnote
3
3
 *
4
 
 * Copyright (C) 2010 Aurimas Cernius
 
4
 * Copyright (C) 2010-2011 Aurimas Cernius
5
5
 * Copyright (C) 2009 Hubert Figuiere
6
6
 *
7
7
 * This program is free software: you can redistribute it and/or modify
84
84
 
85
85
static const char * PREFS_FILE = "stickynoteimport.ini";
86
86
 
87
 
const char * TB_STICKYNOTEIMPORTER_FIRST_RUN =
88
 
  "/apps/tomboy/sticky_note_importer/sticky_importer_first_run";
89
 
 
90
87
bool StickyNoteImportNoteAddin::s_static_inited = false;
91
88
bool StickyNoteImportNoteAddin::s_sticky_file_might_exist = true;
92
89
bool StickyNoteImportNoteAddin::s_sticky_file_existence_confirmed = false;
144
141
 
145
142
  if(s_sticky_file_might_exist) {
146
143
    want_run = !ini_file.get_bool("status", "first_run");
147
 
 
148
 
    if(want_run) {
149
 
      // we think we want to run
150
 
      // so we check for Tomboy. If Tomboy wants to run then we want
151
 
 
152
 
      GConfClient * client = Preferences::obj().get_client();
153
 
      GError * error = NULL;
154
 
      gboolean tb_must_run = gconf_client_get_bool(client,
155
 
                                                   TB_STICKYNOTEIMPORTER_FIRST_RUN,
156
 
                                                   &error);
157
 
      if(error) {
158
 
        // the key don't exist. Tomboy has not been installed.
159
 
        // we want to run.
160
 
        DBG_OUT("gconf error %s", error->message);
161
 
        tb_must_run = true;
162
 
        g_error_free(error);
163
 
      }
164
 
      DBG_OUT("tb_must_run %d", tb_must_run);
165
 
      // we decided that if Tomboy don't want to run then SticjyNotes are
166
 
      // probably already imported.
167
 
      if(!tb_must_run) {
168
 
        // Mark like we already ran.
169
 
        ini_file.set_bool("status", "first_run", true);
170
 
//        Preferences::obj().set<bool>(Preferences::STICKYNOTEIMPORTER_FIRST_RUN, false);
171
 
        want_run = false;
172
 
      }
173
 
    }
174
144
  }
175
145
  return want_run;
176
146
}
185
155
  ini_file.load();
186
156
 
187
157
  bool firstRun = !ini_file.get_bool("status", "first_run");
188
 
//Preferences::obj().get<bool> (Preferences::STICKYNOTEIMPORTER_FIRST_RUN);
189
158
 
190
159
  if (firstRun) {
191
160
    ini_file.set_bool("status", "first_run", true);
192
161
 
193
 
//    Preferences::obj().set<bool> (Preferences::STICKYNOTEIMPORTER_FIRST_RUN, false);
194
 
 
195
162
    DBG_OUT(DEBUG_FIRST_RUN_DETECTED);
196
163
 
197
164
    xmlDocPtr xml_doc = get_sticky_xml_doc();