+2007-06-17 [wwp] 2.9.2cvs68
+
+ * src/ldif.c
+ * src/importldif.c
+ LDIF import: better error handling, minor code
+ and UI cleanup, and renamed the Save button
+ to Close, as imported stuff is already saved
+ when the Save button is shown.
+
2007-06-17 [colin] 2.9.2cvs67
* src/prefs_summaries.c
( cvs diff -u -r 1.1.2.42 -r 1.1.2.43 src/prefs_summaries.c; cvs diff -u -r 1.150.2.96 -r 1.150.2.97 src/procmsg.c; ) > 2.9.2cvs65.patchset
( cvs diff -u -r 1.17.2.34 -r 1.17.2.35 src/alertpanel.c; ) > 2.9.2cvs66.patchset
( cvs diff -u -r 1.1.2.43 -r 1.1.2.44 src/prefs_summaries.c; cvs diff -u -r 1.150.2.97 -r 1.150.2.98 src/procmsg.c; ) > 2.9.2cvs67.patchset
+( cvs diff -u -r 1.12.2.12 -r 1.12.2.13 src/ldif.c; cvs diff -u -r 1.14.2.13 -r 1.14.2.14 src/importldif.c; ) > 2.9.2cvs68.patchset
gtk_entry_set_text( GTK_ENTRY(impldif_dlg.entryFile), sFile );
gtk_entry_set_text( GTK_ENTRY(impldif_dlg.entryName), sName );
- if( *sFile == '\0'|| strlen( sFile ) < 1 ) {
+ if( *sFile == '\0' ) {
sMsg = _( "Please select a file." );
gtk_widget_grab_focus(impldif_dlg.entryFile);
errFlag = TRUE;
}
- if( *sName == '\0'|| strlen( sName ) < 1 ) {
- if( ! errFlag ) sMsg = _( "Address book name must be supplied." );
+ if( ! errFlag && *sName == '\0' ) {
+ sMsg = _( "Address book name must be supplied." );
gtk_widget_grab_focus(impldif_dlg.entryName);
errFlag = TRUE;
}
retVal = TRUE;
}
else {
- sMsg = _( "Error reading LDIF fields." );
+ sMsg = imp_ldif_err2string( _lutErrorsLDIF_, _ldifFile_->retVal );
}
}
imp_ldif_status_show( sMsg );
}
else {
gtk_widget_set_sensitive( impldif_dlg.btnPrev, FALSE );
+ _ldifFile_->dirtyFlag = TRUE;
}
}
else if( pageNum == PAGE_ATTRIBUTES ) {
gtk_notebook_set_current_page(
GTK_NOTEBOOK(impldif_dlg.notebook), PAGE_FINISH );
gtk_button_set_label(GTK_BUTTON(impldif_dlg.btnCancel),
- GTK_STOCK_SAVE);
+ GTK_STOCK_CLOSE);
imp_ldif_finish_show();
}
}
/* Next row */
++top;
- label = gtk_label_new( _( "???" ) );
- /*
- gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1),
- GTK_FILL, 0, 0, 0);
- */
- gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
/*
* Use an event box to attach some help in the form of a tooltip.
while( i < LDIFBUFSIZE-1 ) {
ch = fgetc( ldifFile->file );
+ if (ferror( ldifFile->file ))
+ ldifFile->retVal = MGU_ERROR_READ;
if( ch == '\0' || ch == EOF ) {
if( i == 0 ) return NULL;
break;
posEnd = ftell( ldifFile->file );
fseek( ldifFile->file, 0L, SEEK_SET );
+ if (posEnd == 0) {
+ ldifFile->retVal = MGU_EOF;
+ return;
+ }
+
/* Process file */
while( ! flagEOF ) {
gchar *line = ldif_get_line( ldifFile );
{
flagMail = TRUE;
}
+ } else {
+ g_strstrip(line);
+ if (*line != '\0') {
+ debug_print("ldif: bad format: '%s'\n", line);
+ ldifFile->retVal = MGU_BAD_FORMAT;
+ }
}
}
}