Bug 602361

Summary: qt 4.7: sqliteman fails to build
Product: [Fedora] Fedora Reporter: Terje Røsten <terje.rosten>
Component: sqlitemanAssignee: Terje Røsten <terje.rosten>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: itamar, jreznik, kevin, ltinkl, petr, rdieter, smparrish, terje.rosten, than
Target Milestone: ---Keywords: Patch, Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-16 21:09:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 599939    
Attachments:
Description Flags
Patch to make SQLiteman build against Qt 4.7 none

Description Terje Røsten 2010-06-09 17:09:41 UTC
Description of problem:

Building sqliteman in rawhide fails:

/usr/bin/c++   -DQT_GUI_LIB -DQT_XML_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_NO_DEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ss\
p-buffer-size=4 -m64 -mtune=generic  -O2 -Wall -I/usr/include/QtGui -I/usr/include/QtXml -I/usr/include/QtSql -I/usr/include/QtCore -I/rpm/BUILD/sqliteman-1.2.1 -I/rp\
m/BUILD/sqliteman-1.2.1/sqliteman -I/rpm/BUILD/sqliteman-1.2.1/sqliteman/. -I/rpm/BUILD/sqliteman-1.2.1/sqliteman/qscintilla2/Qt4 -I/rpm/BUILD/sqliteman-1.2.1/sqlitem\
an/qscintilla2/Qt4/Qsci   -DTRANSLATION_DIR=\"/usr/share/sqliteman/\" -DDOC_DIR=\"/usr/share/sqliteman/doc/\" -DICON_DIR=\"/usr/share/sqliteman/icons\" -DSQLITE_BINAR\
Y=\"sqlite3\" -DSQLITEMAN_VERSION=\"1.2.1\" -o CMakeFiles/sqliteman.dir/altertabledialog.o -c /rpm/BUILD/sqliteman-1.2.1/sqliteman/altertabledialog.cpp
/rpm/BUILD/sqliteman-1.2.1/sqliteman/altertabledialog.cpp: In member function 'virtual void AlterTableDialog::createButton_clicked()':
/rpm/BUILD/sqliteman-1.2.1/sqliteman/altertabledialog.cpp:164: error: call of overloaded 'QString(int)' is ambiguous
/usr/include/QtCore/qstring.h:427: note: candidates are: QString::QString(const QByteArray&)
/usr/include/QtCore/qstring.h:425: note:                 QString::QString(const char*)
/usr/include/QtCore/qstring.h:726: note:                 QString::QString(const QString&)
/usr/include/QtCore/qstring.h:106: note:                 QString::QString(QChar)
/usr/include/QtCore/qstring.h:105: note:                 QString::QString(const QChar*)
make[2]: *** [sqliteman/CMakeFiles/sqliteman.dir/altertabledialog.o] Error 1

Also see bug #599939

Sources in altertabledialog.cpp:

void AlterTableDialog::createButton_clicked()
{
        ui.resultEdit->clear();
        // rename table if it's required
        if (!renameTable())
                return;

        // drop columns first
//      if (m_dropColumns > 0)
        {
                QStringList existingObjects = Database::getObjects().keys();  // <---- Line 164 is here
                // indexes and triggers on the original table
                QStringList originalSrc = originalSource();


It builds just fine in Fedora 7 -> Fedora 13, seems like some changes in Qt 4.7 broke it.

Any ideas?

Comment 1 Rex Dieter 2010-06-09 18:15:33 UTC
sqliteman will require patching to remove any instances of ambiguous QString(0), which was silently accepted with < qt-4.7

Comment 2 Rex Dieter 2010-06-09 18:16:39 UTC
I take that back, not just 0, any instance of QString(foo), where foo is of type int.

Comment 3 Terje Røsten 2010-06-09 18:52:28 UTC
That was my fear :-)

Thanks for the quick response!

Comment 4 Kevin Kofler 2010-06-09 21:53:01 UTC
Actually, QString(non-0 integer) was never accepted. 0 is special in C++, it can be silently converted to any pointer type. QString(0) was previously interpreted as QString((char*)0). Now there's also a QString(QChar *), so now it's ambiguous.

But since QString((char*)0) is the same and less efficient as just QString(), the best fix is to just remove the 0.

Comment 5 Kevin Kofler 2010-06-09 21:53:55 UTC
(Actually, it's const char * and const QChar *.)

Comment 6 Alec Moskvin 2010-06-16 19:42:11 UTC
Created attachment 424566 [details]
Patch to make SQLiteman build against Qt 4.7

I made a patch, but the SQLiteman Bugtracker won't let me register, so I'm posting it here...

This patch is against trunk, but it also applies to the stable version (1.2.1).

Comment 7 Terje Røsten 2010-06-16 21:09:22 UTC
I have pushed the fix to rawhide and updated the SQLiteman Bugtracker with
relevant information.

Thank you very much Alec!

Comment 8 Petr Vanek 2010-06-19 20:00:50 UTC
hi guys,

I'm the author of Sqliteman. At first - I'd like to thank you for your investigation (and patch of course). Trunk and 1.2.x branch are patched and it's working.

I did a new release - 1.2.2. It contains fixes for:
#146: Views with spaces in name are not displayed correctly
#163: sqliteman 1.2.1 don't build with qt 4.7

source tarballs are located at sourceforge.

Some binary packages for Suse and Fedora are already prebuilt in OpenSuse's build service:
http://download.opensuse.org/repositories/home:/subik/

spec file is in the SVN in Packagers directory (if you are interested).

Please contact me again when you will face another issues.

at last - I do apologise for so much delayed reaction. Sqliteman is not my main project and I don't monitor its bugtracker daily (yes, e-mail notifications were broken).

all the best,
Petr