Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 focuswriter (1.4.5-1) unstable; urgency=medium
 .
   * New upstream release
   * Track upstream maintenance branch
     - da6b829 FIXED: Long session names made session menu unworkable.
     - d3d8119 FIXED: Theme names could not contain periods.
     - bb84e4e FIXED: Session names could not contain periods.
Author: Barak A. Pearlmutter <bap@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- focuswriter-1.4.5.orig/src/session.cpp
+++ focuswriter-1.4.5/src/session.cpp
@@ -139,7 +139,7 @@ QString Session::pathFromName(const QStr
 
 QString Session::pathToName(const QString& path)
 {
-	return QUrl::fromPercentEncoding(QFileInfo(path).baseName().toUtf8());
+	return QUrl::fromPercentEncoding(QFileInfo(path).completeBaseName().toUtf8());
 }
 
 //-----------------------------------------------------------------------------
--- focuswriter-1.4.5.orig/src/session_manager.cpp
+++ focuswriter-1.4.5/src/session_manager.cpp
@@ -1,6 +1,6 @@
 /***********************************************************************
  *
- * Copyright (C) 2010, 2011, 2012 Graeme Gott <graeme@gottcode.org>
+ * Copyright (C) 2010, 2011, 2012, 2014 Graeme Gott <graeme@gottcode.org>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -381,7 +381,7 @@ void SessionManager::updateList(const QS
 			continue;
 		}
 
-		QAction* action = m_sessions_menu->addAction(name);
+		QAction* action = m_sessions_menu->addAction(fontMetrics().elidedText(name, Qt::ElideRight, 3 * logicalDpiX()));
 		action->setData(name);
 		action->setCheckable(true);
 		m_sessions_actions->addAction(action);
--- focuswriter-1.4.5.orig/src/theme_manager.cpp
+++ focuswriter-1.4.5/src/theme_manager.cpp
@@ -60,7 +60,7 @@ ThemeManager::ThemeManager(QSettings& se
 	m_themes->setWordWrap(true);
 	QStringList themes = QDir(Theme::path(), "*.theme").entryList(QDir::Files, QDir::Name | QDir::IgnoreCase);
 	foreach (const QString& theme, themes) {
-		addItem(QUrl::fromPercentEncoding(QFileInfo(theme).baseName().toUtf8()));
+		addItem(QUrl::fromPercentEncoding(QFileInfo(theme).completeBaseName().toUtf8()));
 	}
 	QList<QListWidgetItem*> items = m_themes->findItems(m_settings.value("ThemeManager/Theme").toString(), Qt::MatchExactly);
 	if (!items.isEmpty()) {
@@ -208,7 +208,7 @@ void ThemeManager::importTheme()
 	}
 
 	// Find theme name
-	QString name = QUrl::fromPercentEncoding(QFileInfo(filename).baseName().toUtf8());
+	QString name = QUrl::fromPercentEncoding(QFileInfo(filename).completeBaseName().toUtf8());
 	while (QFile::exists(Theme::filePath(name))) {
 		bool ok;
 		name = QInputDialog::getText(this, tr("Sorry"), tr("A theme already exists with that name. Please enter a new name:"), QLineEdit::Normal, name, &ok);
