This patch removes qt2 support as discussed two weeks ago. It does not 
touch the ui files, these should IMHO only be converted if they are 
edited anyway. It does neither remove deprecated function calls, e.g. 
QApplication::clipboard()->setSelectionMode(true|false). We should/need 
only do that in the qt4 frontend.
It was also discussed to rename the qt2 directory to qt3, but I am not 
sure whether we should do that, it might have unforeseen side effects. 
Opinions?

This patch is going in trunk now.


Georg


Log:

Remove qt2 support in the following files:
        * src/frontends/qt2/qt_helpers.C
        (makeFontName):

        * src/frontends/qt2/QWorkArea.C
        (QWorkArea::haveSelection):
        (QWorkArea::haveSelection):
        (QWorkArea::getClipboard):

        * src/frontends/qt2/panelstack.C
        (PanelStack::PanelStack):

        * src/frontends/qt4/qt_helpers.C
        (makeFontName):

        * README: remove notice about qt2

        * config/qt.m4: make 3.0 the minimum required qt version
Index: src/frontends/qt2/qt_helpers.C
===================================================================
--- src/frontends/qt2/qt_helpers.C	(Revision 13413)
+++ src/frontends/qt2/qt_helpers.C	(Arbeitskopie)
@@ -38,29 +38,17 @@ string makeFontName(string const & famil
 {
 	if (foundry.empty())
 		return family;
-#if QT_VERSION  >= 300
 	return family + " [" + foundry + ']';
-#else
-	return foundry + '-' + family;
-#endif
 }
 
 
 pair<string,string> parseFontName(string const & name)
 {
-#if QT_VERSION  >= 300
 	string::size_type const idx = name.find('[');
 	if (idx == string::npos || idx == 0)
 		return make_pair(name, string());
 	return make_pair(name.substr(0, idx - 1),
 			 name.substr(idx + 1, name.size() - idx - 2));
-#else
-	string::size_type const idx = name.find('-');
-	if (idx == string::npos || idx == 0)
-		return make_pair(name, string());
-	return make_pair(name.substr(idx + 1),
-			 name.substr(0, idx));
-#endif
 }
 
 
Index: src/frontends/qt2/QWorkArea.C
===================================================================
--- src/frontends/qt2/QWorkArea.C	(Revision 13413)
+++ src/frontends/qt2/QWorkArea.C	(Arbeitskopie)
@@ -184,7 +184,6 @@ void QWorkArea::haveSelection(bool own) 
 {
 	wa_ptr = this;
 
-#if QT_VERSION >= 300
 	if (!QApplication::clipboard()->supportsSelection())
 		return;
 
@@ -194,15 +193,12 @@ void QWorkArea::haveSelection(bool own) 
 	}
 	// We don't need to do anything if own = false, as this case is
 	// handled by QT.
-#endif
 }
 
 
 string const QWorkArea::getClipboard() const
 {
-#if QT_VERSION >= 300
 	QApplication::clipboard()->setSelectionMode(true);
-#endif
 	QString str = QApplication::clipboard()->text();
 	if (str.isNull())
 		return string();
@@ -217,9 +213,7 @@ string const QWorkArea::getClipboard() c
 
 void QWorkArea::putClipboard(string const & str) const
 {
-#if QT_VERSION >= 300
 	QApplication::clipboard()->setSelectionMode(true);
-#endif
 #ifdef Q_OS_MAC
 	// The MAC clipboard uses \r for lineendings, and we use \n
 	QApplication::clipboard()->setText(toqstr(subst(str, '\n', '\r')));
Index: src/frontends/qt2/panelstack.C
===================================================================
--- src/frontends/qt2/panelstack.C	(Revision 13413)
+++ src/frontends/qt2/panelstack.C	(Arbeitskopie)
@@ -37,9 +37,7 @@ PanelStack::PanelStack(QWidget * parent,
 	list_->setVScrollBarMode(QScrollView::AlwaysOff);
 	list_->addColumn("");
 	list_->setColumnWidthMode(0, QListView::Maximum);
-#if QT_VERSION >= 300
 	list_->setResizeMode(QListView::AllColumns);
-#endif
 	list_->setRootIsDecorated(true);
 	QWidget * w = static_cast<QWidget*>(list_->child("list view header"));
 	if (w)
Index: src/frontends/qt4/qt_helpers.C
===================================================================
--- src/frontends/qt4/qt_helpers.C	(Revision 13413)
+++ src/frontends/qt4/qt_helpers.C	(Arbeitskopie)
@@ -38,29 +38,17 @@ string makeFontName(string const & famil
 {
 	if (foundry.empty())
 		return family;
-#if QT_VERSION  >= 300
 	return family + " [" + foundry + ']';
-#else
-	return foundry + '-' + family;
-#endif
 }
 
 
 pair<string,string> parseFontName(string const & name)
 {
-#if QT_VERSION  >= 300
 	string::size_type const idx = name.find('[');
 	if (idx == string::npos || idx == 0)
 		return make_pair(name, string());
 	return make_pair(name.substr(0, idx - 1),
 			 name.substr(idx + 1, name.size() - idx - 2));
-#else
-	string::size_type const idx = name.find('-');
-	if (idx == string::npos || idx == 0)
-		return make_pair(name, string());
-	return make_pair(name.substr(idx + 1),
-			 name.substr(0, idx));
-#endif
 }
 
 
Index: README
===================================================================
--- README	(Revision 13413)
+++ README	(Arbeitskopie)
@@ -83,8 +83,7 @@ What do I need to compile LyX from the s
     * LibXpm, version 4.7 or newer.
 
     Or:
-    * The Qt library, version 3.0 or newer (although version 2.3
-    may work).
+    * The Qt library, version 3.0 or newer.
 
     Read the file "INSTALL" for more information on compiling.
 
Index: config/qt.m4
===================================================================
--- config/qt.m4	(Revision 13413)
+++ config/qt.m4	(Arbeitskopie)
@@ -96,7 +96,7 @@ AC_DEFUN([QT_TRY_LINK],
 		],
 	[
 	QString s("mangle_failure");
-	#if (QT_VERSION < 221)
+	#if (QT_VERSION < 0x030000)
 	break_me_(\\\);
 	#endif
 	],

Reply via email to