Index: src/import-export/qif-import/schemas/apps_gnucash_import_qif.schemas.in
===================================================================
--- src/import-export/qif-import/schemas/apps_gnucash_import_qif.schemas.in	(révision 19648)
+++ src/import-export/qif-import/schemas/apps_gnucash_import_qif.schemas.in	(copie de travail)
@@ -16,5 +16,19 @@
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/apps/gnucash/dialogs/import/qif/default_status</key>
+      <applyto>/apps/gnucash/dialogs/import/qif/default_status</applyto>
+      <owner>gnucash</owner>
+      <type>string</type>
+      <default>not_cleared</default>
+      <locale name="C">
+        <short>Default QIF transaction status</short>
+        <long>
+          Default status for QIF transaction when not specified in QIF file.
+        </long>
+      </locale>
+    </schema>
+
   </schemalist>
 </gconfschemafile>
Index: src/import-export/qif-import/qif-to-gnc.scm
===================================================================
--- src/import-export/qif-import/qif-to-gnc.scm	(révision 19648)
+++ src/import-export/qif-import/qif-to-gnc.scm	(copie de travail)
@@ -215,7 +215,9 @@
 (define (qif-import:qif-to-gnc qif-files-list
                                qif-acct-map qif-cat-map
                                qif-memo-map stock-map
-                               default-currency-name progress-dialog)
+                               default-currency-name
+                               transaction-status-pref
+                               progress-dialog)
 
   ;; This procedure does all the work. We'll define it, then call it safely.
   (define (private-convert)
@@ -392,6 +394,7 @@
                                                  qif-acct-map
                                                  qif-cat-map
                                                  qif-memo-map
+                                                 transaction-status-pref
                                                  progress-dialog)
 
                   ;; rebalance and commit everything
@@ -423,6 +426,7 @@
 (define (qif-import:qif-xtn-to-gnc-xtn qif-xtn qif-file gnc-xtn
                                        gnc-acct-hash
                                        qif-acct-map qif-cat-map qif-memo-map
+                                       transaction-status-pref
                                        progress-dialog)
   (let ((splits (qif-xtn:splits qif-xtn))
         (gnc-near-split (xaccMallocSplit (gnc-get-current-book)))
@@ -490,10 +494,15 @@
 	      ;; the debit/credit lines. See bug 495219 for more information.
 	      (xaccTransSetNotes gnc-xtn qif-memo)))
 
+    ;; Look for the transaction status (QIF "C" line). When it exists, apply
+    ;; the cleared (c) or reconciled (y) status to the split. Otherwise, apply
+    ;; user preference.
     (if (eq? qif-cleared 'cleared)
-        (xaccSplitSetReconcile gnc-near-split #\c))
-    (if (eq? qif-cleared 'reconciled)
-        (xaccSplitSetReconcile gnc-near-split #\y))
+        (xaccSplitSetReconcile gnc-near-split #\c)
+        (if (eq? qif-cleared 'reconciled)
+            (xaccSplitSetReconcile gnc-near-split #\y)
+            ;; Apply user preference by default.
+            (xaccSplitSetReconcile gnc-near-split transaction-status-pref)))
 
     (if (not qif-security)
         (begin
Index: src/import-export/qif-import/qif.glade
===================================================================
--- src/import-export/qif-import/qif.glade	(révision 19648)
+++ src/import-export/qif-import/qif.glade	(copie de travail)
@@ -1380,9 +1380,76 @@
           </packing>
         </child>
         <child>
-          <placeholder/>
+          <widget class="GtkRadioButton" id="gconf/dialogs/import/qif/default_status/reconciled">
+            <property name="label" translatable="yes">_Reconciled</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="tooltip" translatable="yes">When the status is not specified in a QIF file, the transactions are marked as reconciled.</property>
+            <property name="use_underline">True</property>
+            <property name="draw_indicator">True</property>
+          </widget>
+          <packing>
+            <property name="top_attach">6</property>
+            <property name="bottom_attach">7</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"></property>
+            <property name="x_padding">12</property>
+          </packing>
         </child>
         <child>
+          <widget class="GtkRadioButton" id="gconf/dialogs/import/qif/default_status/cleared">
+            <property name="label" translatable="yes">_Cleared</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="tooltip" translatable="yes">When the status is not specified in a QIF file, the transactions are marked as cleared.</property>
+            <property name="use_underline">True</property>
+            <property name="draw_indicator">True</property>
+            <property name="group">gconf/dialogs/import/qif/default_status/reconciled</property>
+          </widget>
+          <packing>
+            <property name="top_attach">5</property>
+            <property name="bottom_attach">6</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"></property>
+            <property name="x_padding">12</property>
+          </packing>
+        </child>
+         <child>
+             <widget class="GtkRadioButton" id="gconf/dialogs/import/qif/default_status/not_cleared">
+            <property name="label" translatable="yes">_Not cleared</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="tooltip" translatable="yes">When the status is not specified in a QIF file, the transactions are marked as not cleared.</property>
+            <property name="use_underline">True</property>
+            <property name="draw_indicator">True</property>
+            <property name="group">gconf/dialogs/import/qif/default_status/reconciled</property>
+          </widget>
+          <packing>
+            <property name="top_attach">4</property>
+            <property name="bottom_attach">5</property>
+            <property name="x_options">GTK_FILL</property>
+            <property name="y_options"></property>
+            <property name="x_padding">12</property>
+          </packing>
+        </child>
+        <child>
+           <widget class="GtkLabel" id="qif_default_transation_status">
+             <property name="visible">True</property>
+             <property name="xalign">0</property>
+             <property name="label" translatable="yes">Default transaction status (overridden by the status given by the QIF file):</property>
+           </widget>
+           <packing>
+             <property name="right_attach">4</property>
+             <property name="top_attach">2</property>
+             <property name="bottom_attach">3</property>
+             <property name="x_options">GTK_FILL</property>
+             <property name="y_options"></property>
+           </packing>
+        </child>
+        <child>
           <placeholder/>
         </child>
         <child>
Index: src/import-export/qif-import/druid-qif-import.c
===================================================================
--- src/import-export/qif-import/druid-qif-import.c	(révision 19648)
+++ src/import-export/qif-import/druid-qif-import.c	(copie de travail)
@@ -56,6 +56,7 @@
 #define DRUID_QIF_IMPORT_CM_CLASS "druid-qif-import"
 #define GCONF_SECTION "dialogs/import/qif"
 #define GCONF_NAME_SHOW_DOC "show_doc"
+#define GCONF_NAME_DEFAULT_TRANSACTION_STATUS "default_status"
 
 #define PREV_ROW "prev_row"
 
@@ -165,6 +166,7 @@
 
     SCM       imported_account_tree;
     SCM       match_transactions;
+    SCM       transaction_status;
     int       selected_transaction;
 };
 
@@ -2637,12 +2639,13 @@
     /* This step will fill 70% of the bar. */
     gnc_progress_dialog_push(wind->convert_progress, 0.7);
     retval = scm_apply(qif_to_gnc,
-                       SCM_LIST7(wind->imported_files,
+                       SCM_LIST8(wind->imported_files,
                                  wind->acct_map_info,
                                  wind->cat_map_info,
                                  wind->memo_map_info,
                                  wind->security_hash,
                                  scm_makfrom0str(currname),
+                                 wind->transaction_status, 
                                  progress),
                        SCM_EOL);
     gnc_progress_dialog_pop(wind->convert_progress);
@@ -3214,6 +3217,8 @@
 get_preferences(QIFImportWindow *wind)
 {
     GError * err = NULL;
+    gchar *status_pref = NULL;
+    gchar tmp_transaction_status = 'n';
 
     g_return_if_fail(wind);
 
@@ -3231,6 +3236,27 @@
         g_warning("QIF import: Documentation pages will be shown by default.");
         wind->show_doc_pages = TRUE;
     }
+
+    /* Clear / Reconcile transaction if not specified in QIF file. */
+    status_pref = gnc_gconf_get_string(
+                    GCONF_SECTION, GCONF_NAME_DEFAULT_TRANSACTION_STATUS, &err);
+    if (err != NULL)
+    {
+        g_warning("QIF import: gnc_gconf_get_string error: %s", err->message);
+        g_error_free(err);
+        g_warning("QIF import: Couldn't get %s setting from gconf.",
+                  GCONF_NAME_DEFAULT_TRANSACTION_STATUS);
+    } else {
+        if (g_strcmp0(status_pref, "cleared") == 0)
+        {
+            tmp_transaction_status = 'c';
+        } else if (g_strcmp0(status_pref, "reconciled") == 0)
+        {
+            tmp_transaction_status = 'y';
+        }
+    }
+    g_free(status_pref);
+    wind->transaction_status = SCM_MAKE_CHAR(tmp_transaction_status);
 }
 
 
