Index: lib/rb-file-helpers.c
===================================================================
--- lib/rb-file-helpers.c	(revision 6068)
+++ lib/rb-file-helpers.c	(working copy)
@@ -46,6 +46,7 @@
 static GHashTable *files = NULL;
 
 static char *dot_dir = NULL;
+static char *xdg_dot_dir = NULL;
 
 const char *
 rb_file (const char *filename)
@@ -98,6 +99,28 @@
 	return dot_dir;
 }
 
+/**
+ * rb_xdg_dot_dir:
+ *
+ * This will create the rhythmbox XDG directory based upon the
+ * g_get_user_date_dir() function.
+ * This folding is usually ~/.local/share/rhythmbox, but not always.
+ *
+ * Returns: allocated string to the rhythmbox XDG directory
+ */
+const char *
+rb_xdg_dot_dir (void)
+{
+	if (xdg_dot_dir == NULL) {
+		xdg_dot_dir = g_build_filename (g_get_user_data_dir (),
+						"rhythmbox",
+						NULL);
+		if (g_mkdir_with_parents (xdg_dot_dir, 0750) == -1)
+			rb_debug ("unable to create Rhythmbox's XDG dot dir");
+	}
+	
+	return xdg_dot_dir;
+}
 
 const char *
 rb_music_dir (void)
@@ -114,6 +137,71 @@
 	return dir;
 }
 
+/**
+ * rb_find_user_data_file:
+ * @name: name of file to find
+ * @move_from_gnome_dir: if TRUE, move the file from .gnome2/rhythmbox
+ *  if the source file doesn't exist, then the XDG directory will be used
+ * @error: returns error information
+ *
+ * Determines the full path to use for various files (include playlists.xml
+ * and rhythmdb.xml, among others).
+ *
+ * Returns: allocated string containing the location of the file to use
+ */
+char *
+rb_find_user_data_file (const char *name, gboolean move_from_gnome_dir,
+			GError **error)
+{
+	GError *temp_err = NULL;
+	char *srcpath;
+	char *destpath;
+	GFile *src;
+	GFile *dest;
+
+	char *use_path;
+//	gboolean ret;
+
+	srcpath = g_build_filename (rb_dot_dir (), name, NULL);
+	destpath = g_build_filename (rb_xdg_dot_dir (), name, NULL);
+
+	src = g_file_new_for_path (srcpath);
+	dest = g_file_new_for_path (destpath);
+
+	if (move_from_gnome_dir) {
+		rb_debug ("Move from gnome dir: TRUE");
+		/* We'll move from the old dir to the new dir */
+		if (g_file_query_exists (src, NULL)) {
+			rb_debug ("File exists");
+			g_file_move (src, dest, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &temp_err);
+			if (temp_err != NULL) {
+				rb_debug ("Error while moving '%s': %s", g_file_get_path (src), temp_err->message);
+				g_propagate_error (error, temp_err);
+				use_path = g_file_get_path (src);
+			} else {
+				rb_debug ("Move was successful");
+				use_path = g_file_get_path (dest);
+			}
+		} else {
+			rb_debug ("Old .gnome2 files doesn't exist, so we use the new XDG path");
+			use_path = g_file_get_path (dest);
+		}
+	} else {
+		rb_debug ("Move from gnome dir: FALSE");
+		use_path = g_file_get_path (src);
+	}
+
+	rb_debug ("Using path %s", use_path);
+
+	g_free (srcpath);
+	g_free (destpath);
+
+	g_object_unref (src);
+	g_object_unref (dest);
+
+	return use_path;
+}
+
 void
 rb_file_helpers_init (void)
 {
@@ -128,6 +216,7 @@
 {
 	g_hash_table_destroy (files);
 	g_free (dot_dir);
+	g_free (xdg_dot_dir);
 }
 
 #define MAX_LINK_LEVEL 5
Index: lib/rb-file-helpers.h
===================================================================
--- lib/rb-file-helpers.h	(revision 6068)
+++ lib/rb-file-helpers.h	(working copy)
@@ -37,8 +37,12 @@
 
 const char *	rb_file			(const char *filename);
 const char *	rb_dot_dir		(void);
+const char *	rb_xdg_dot_dir		(void);
 const char *	rb_music_dir		(void);
 
+char *		rb_find_user_data_file	(const char *name, gboolean move_from_gnome_dir,
+					 GError **error);
+
 char *		rb_canonicalise_uri	(const char *uri);
 
 gboolean	rb_uri_mkstemp		(const char *prefix, char **uri,
Index: shell/rb-shell.c
===================================================================
--- shell/rb-shell.c	(revision 6068)
+++ shell/rb-shell.c	(working copy)
@@ -691,6 +691,7 @@
 	shell->priv = RB_SHELL_GET_PRIVATE (shell);
 
 	rb_dot_dir ();
+	rb_xdg_dot_dir();
 
         rb_shell_session_init (shell);
 
@@ -968,23 +969,11 @@
 	      char *rhythmdb,
 	      char *playlists)
 {
-	RBShell *s;
-	char *pathname;
-
-	/* set default playlist name, if none supplied */
-	if (playlists) 
-		pathname = g_strdup (playlists);
-	else 
-		pathname = g_build_filename (rb_dot_dir (), "playlists.xml", NULL); 
-	
-	s = g_object_new (RB_TYPE_SHELL,
+	return g_object_new (RB_TYPE_SHELL,
 			  "no-registration", no_registration,
 			  "no-update", no_update,
 			  "dry-run", dry_run, "rhythmdb-file", rhythmdb, 
-			  "playlists-file", pathname, NULL);
-
-	g_free (pathname);
-	return s;
+			  "playlists-file", playlists, NULL);
 }
 
 static GMountOperation *
@@ -1001,16 +990,24 @@
 static void
 construct_db (RBShell *shell)
 {
+	GError *error = NULL;
 	char *pathname;
 
 	/* Initialize the database */
 	rb_debug ("creating database object");
 	rb_profile_start ("creating database object");
 
-	if (shell->priv->rhythmdb_file)
+	if (shell->priv->rhythmdb_file) {
 		pathname = g_strdup (shell->priv->rhythmdb_file);
-	else
-		pathname = g_build_filename (rb_dot_dir (), "rhythmdb.xml", NULL);
+	} else {
+		pathname = rb_find_user_data_file("rhythmdb.xml", TRUE, &error);
+		if(error != NULL) {
+			rb_error_dialog (GTK_WINDOW (shell->priv->window),
+					 _("Error moving rhythmdb.xml"),
+					 "%s", error->message);
+			g_error_free (error);
+		}
+	}
 
 #ifdef WITH_RHYTHMDB_TREE
 	shell->priv->db = rhythmdb_tree_new (pathname);
@@ -1197,6 +1194,9 @@
 static void
 construct_sources (RBShell *shell)
 {
+	GError *error = NULL;
+	char *pathname;
+
 	rb_profile_start ("constructing sources");
 
 	shell->priv->library_source = RB_LIBRARY_SOURCE (rb_library_source_new (shell));
@@ -1208,10 +1208,23 @@
 	shell->priv->import_errors_source = rb_import_errors_source_new (shell, RHYTHMDB_ENTRY_TYPE_IMPORT_ERROR);
 	rb_shell_append_source (shell, shell->priv->import_errors_source, NULL);
 
+	/* Find the playlist name if none supplied */
+	if (shell->priv->playlists_file) {
+		pathname = g_strdup (shell->priv->playlists_file);
+	} else {
+		pathname = rb_find_user_data_file ("playlists.xml", TRUE, &error);
+		if(error != NULL) {
+			rb_error_dialog (GTK_WINDOW (shell->priv->window),
+					 _("Error moving playlists.xml"),
+					 "%s", error->message);
+			g_error_free (error);
+		}
+	}
+
 	/* Initialize playlist manager */
 	rb_debug ("shell: creating playlist manager");
 	shell->priv->playlist_manager = rb_playlist_manager_new (shell,
-								 RB_SOURCELIST (shell->priv->sourcelist), shell->priv->playlists_file);
+								 RB_SOURCELIST (shell->priv->sourcelist), pathname);
 
 	g_object_set (G_OBJECT(shell->priv->clipboard_shell), "playlist-manager", shell->priv->playlist_manager, NULL);
 
@@ -1229,6 +1242,8 @@
 	g_signal_connect_object (G_OBJECT (shell->priv->removable_media_manager), "transfer-progress",
 				 G_CALLBACK (rb_shell_transfer_progress_cb), shell, 0);
 
+	g_free (pathname);
+
 	rb_profile_end ("constructing sources");
 }
 
