Properly process Gtk2 error-times as gint64s.
[doldaconnect.git] / clients / gtk2 / dolcon.c
index 60374f3..a5adc12 100644 (file)
@@ -41,6 +41,7 @@
 #include <pwd.h>
 #include <locale.h>
 #include <assert.h>
+#include <stdint.h>
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -420,7 +421,7 @@ void transspeedinfo(GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel
 void transerrorinfo(GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
 {
     int error;
-    time_t errortime;
+    gint64 errortime;
     char finbuf[64], tbuf[64], *errstr;
     
     gtk_tree_model_get(model, iter, 10, &error, 11, &errortime, -1);
@@ -430,7 +431,7 @@ void transerrorinfo(GtkTreeViewColumn *col, GtkCellRenderer *rend, GtkTreeModel
            errstr = _("Not found");
        else if(error == DC_TRNSE_NOSLOTS)
            errstr = _("No slots");
-       strftime(tbuf, 64, _("%H:%M:%S"), localtime(&errortime));
+       strftime(tbuf, 64, _("%H:%M:%S"), localtime((const time_t[]){errortime}));
        snprintf(finbuf, 64, _("%s (reported at %s)"), errstr, tbuf);
     } else {
        *finbuf = 0;
@@ -479,8 +480,7 @@ void updatetransferlists(void)
     char *buf;
     char *peerid, *peernick, *path, *hash;
     int state, dir, error;
-    gint64 size, curpos;
-    time_t errortime;
+    gint64 size, curpos, errortime;
     GtkListStore *stores[3];
     
     for(transfer = dc_transfers; transfer != NULL; transfer = transfer->next)
@@ -569,7 +569,7 @@ void updatetransferlists(void)
                                   8, gettrstatestock(transfer->state),
                                   9, 0.0,
                                   10, transfer->error,
-                                  11, transfer->errortime,
+                                  11, (gint64)transfer->errortime,
                                   12, hash,
                                   -1);
                free(peerid);
@@ -829,7 +829,7 @@ void logincallback(int err, wchar_t *reason, void *data)
     switch(err)
     {
     case DC_LOGIN_ERR_SUCCESS:
-       dc_queuecmd(NULL, NULL, L"notify", L"all", L"on", NULL);
+       dc_queuecmd(NULL, NULL, L"notify", L"all", L"on", L"fn:peer", L"off", NULL);
        dc_getfnlistasync(getfnlistcallback, NULL);
        dc_gettrlistasync(gettrlistcallback, NULL);
        updatesbar("Authenticated");
@@ -1165,9 +1165,8 @@ void handleresps(void)
                            if((buf = icwcstombs(ires->argv[1].val.str, "UTF-8")) != NULL)
                            {
                                p = buf;
-                               /* XXX: Too NMDC-specific! */
-                               if(strrchr(p, '\\') != NULL)
-                                   p = strrchr(p, '\\') + 1;
+                               if(strrchr(p, '/') != NULL)
+                                   p = strrchr(p, '/') + 1;
                                gtk_tree_store_set(srchmodel, &piter, 3, p, -1);
                                free(buf);
                            }
@@ -2256,7 +2255,7 @@ int main(int argc, char **argv)
     }
     dc_init();
     signal(SIGCHLD, SIG_IGN);
-    pubhubaddr = sstrdup("http://www.hublist.org/PublicHubList.xml.bz2");
+    pubhubaddr = sstrdup("http://dchublist.com/hublist.xml.bz2");
     dcserver = sstrdup("");
     if((pwent = getpwuid(getuid())) == NULL)
     {
@@ -2288,7 +2287,7 @@ int main(int argc, char **argv)
                                 G_TYPE_STRING,  /* stock */
                                 G_TYPE_FLOAT,   /* percentage */
                                 G_TYPE_INT,     /* error */
-                                G_TYPE_INT,     /* errortime */
+                                G_TYPE_INT64,   /* errortime */
                                 G_TYPE_STRING); /* hash */
     gtk_tree_view_set_model(GTK_TREE_VIEW(main_downloads), GTK_TREE_MODEL(dlmodel));