* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "main.h"
#include "collect.h"
+#include <sys/stat.h>
+
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+#include <utility>
+
+#include <glib-object.h>
+
#include "collect-dlg.h"
#include "collect-io.h"
#include "collect-table.h"
+#include "compat.h"
+#include "debug.h"
#include "filedata.h"
#include "img-view.h"
+#include "intl.h"
#include "layout-image.h"
#include "layout-util.h"
+#include "layout.h"
+#include "main-defines.h"
#include "misc.h"
+#include "options.h"
#include "pixbuf-util.h"
#include "print.h"
#include "ui-fileops.h"
#include "ui-tree-edit.h"
+#include "ui-utildlg.h"
#include "utilops.h"
#include "window.h"
-#define COLLECT_DEF_WIDTH 440
-#define COLLECT_DEF_HEIGHT 450
+enum {
+ COLLECT_DEF_WIDTH = 440,
+ COLLECT_DEF_HEIGHT = 450
+};
/**
* list of paths to collections */
GList *collection_list_randomize(GList *list)
{
- guint random, length, i;
- gpointer tmp;
- GList *nlist, *olist;
+ guint random;
+ guint length;
+ guint i;
+ GList *nlist;
+ GList *olist;
length = g_list_length(list);
if (!length) return nullptr;
random = static_cast<guint>(1.0 * length * rand()/(RAND_MAX + 1.0));
olist = g_list_nth(list, i);
nlist = g_list_nth(list, random);
- tmp = olist->data;
- olist->data = nlist->data;
- nlist->data = tmp;
+ std::swap(olist->data, nlist->data);
}
return list;