Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -918,13 +918,16 @@ AC_CHECK_FUNCS([reiserfs_fs_open_fast])
LIBS="$OLDLIBS"
AC_CHECK_FUNCS([ntfs_libntfs_version ntfs_volume_startup])

export QT_SELECT=qt5
export QT_SELECT=qt6
if test "$use_qt" = "true";
then
PKG_CHECK_MODULES(QT5GUI, [Qt5Gui >= 5.0.0],,use_qt=false)
PKG_CHECK_MODULES(QT5WIDGETS, [Qt5Widgets >= 5.0.0],,use_qt=false)
AC_MSG_CHECKING([whether Qt5 is using --std=c++14])
qt_config=`$PKG_CONFIG --variable=qt_config Qt5Core | grep "c++14"`
PKG_CHECK_MODULES(QT6CORE, [Qt6Core >= 6.0.0],,use_qt=false)
PKG_CHECK_MODULES(QT6GUI, [Qt6Gui >= 6.0.0],,use_qt=false)
PKG_CHECK_MODULES(QT6WIDGETS, [Qt6Widgets >= 6.0.0],,use_qt=false)


AC_MSG_CHECKING([whether Qt6 is using --std=c++14])
qt_config=`$PKG_CONFIG --variable=qt_config Qt6Core | grep "c++14"`
if test "x$qt_config" != "x" ;
then
AC_MSG_RESULT([[yes]])
Expand All @@ -943,8 +946,8 @@ then
AC_LANG_POP([C++])
else
AC_MSG_RESULT([[no]])
AC_MSG_CHECKING([whether Qt5 is using --std=c++11])
qt_config=`$PKG_CONFIG --variable=qt_config Qt5Core | grep "c++11"`
AC_MSG_CHECKING([whether QT6 is using --std=c++11])
qt_config=`$PKG_CONFIG --variable=qt_config Qt6Core | grep "c++11"`
if test "x$qt_config" != "x" ;
then
AC_MSG_RESULT([[yes]])
Expand All @@ -966,23 +969,27 @@ then
fi
fi

AC_CHECK_TOOLS(MOC,[moc-qt5 moc],)

PKG_CHECK_VAR([QT_LIBEXECDIR], [Qt6Core >= 6.0.0], [libexecdir])
PKG_CHECK_VAR([QT_BINDIR], [Qt6Core >= 6.0.0], [bindir])

AC_PATH_PROGS([MOC],[moc-qt6 moc],[],["$QT_LIBEXECDIR:$QT_BINDIR:$PATH"])
if test x$MOC = x ; then
AC_MSG_WARN(Could not find a moc-qt5 or moc tool in your PATH.)
AC_MSG_WARN(Could not find a moc-qt6 or moc tool in your PATH.)
use_qt=false
fi
AC_CHECK_TOOLS(RCC,[rcc-qt5 rcc],)
AC_PATH_PROGS([RCC],[rcc-qt6 rcc],[],["$QT_LIBEXECDIR:$QT_BINDIR:$PATH"])
if test x$RCC = x ; then
AC_MSG_WARN(Could not find a rcc-qt5 or rcc tool in your PATH.)
AC_MSG_WARN(Could not find a rcc-qt6 or rcc tool in your PATH.)
use_qt=false
fi
AC_CHECK_TOOLS(LRELEASE,[lrelease-qt5 lrelease],)
AC_PATH_PROGS([LRELEASE],[lrelease-qt6 lrelease],[],["$QT_LIBEXECDIR:$QT_BINDIR:$PATH"])
if test x$LRELEASE = x ; then
AC_MSG_WARN(Could not find a lrelease-qt5 or lrelease tool in your PATH.)
AC_MSG_WARN(Could not find a lrelease-qt6 or lrelease tool in your PATH.)
use_qt=false
fi
qphotorec_LDADD="$qphotorec_LDADD $QT5GUI_LIBS $QT5WIDGETS_LIBS"
qphotorec_CXXFLAGS="$qphotorec_CXXFLAGS $QT5GUI_CFLAGS $QT5WIDGETS_CFLAGS"
qphotorec_LDADD="$qphotorec_LDADD $QT6GUI_LIBS $QT6WIDGETS_LIBS"
qphotorec_CXXFLAGS="$qphotorec_CXXFLAGS $QT6GUI_CFLAGS $QT6WIDGETS_CFLAGS"
fi
AM_CONDITIONAL(USEQT, test "$use_qt" = true)
if test "$win_target" = yes;
Expand Down
2 changes: 1 addition & 1 deletion src/intrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void screen_buffer_to_log(void)
log_info("%s\n",intr_buffer_screen[i]);
}

int get_partition_status(const partition_t *partition)
char get_partition_status(const partition_t *partition)
{
switch(partition->status)
{
Expand Down
2 changes: 1 addition & 1 deletion src/intrf.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void screen_buffer_to_log(void);
@ terminates \true;
@ assigns \nothing;
@*/
int get_partition_status(const partition_t *partition);
char get_partition_status(const partition_t *partition);

#ifdef __cplusplus
} /* closing brace for extern "C" */
Expand Down
6 changes: 2 additions & 4 deletions src/qphotorec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,11 @@ void QPhotorec::PartListWidget_updateUI()
QString partname="";
if(partition->partname[0]!='\0')
{
partname.sprintf("[%s]", partition->partname);
QTextStream(&partname) << "[" << partition->partname << "]";
}
if(partition->fsname[0]!='\0')
{
QString fsname;
fsname.sprintf(" [%s]", partition->fsname);
partname.append(fsname);
QTextStream(&partname) << " [" << partition->fsname << "]";
}
PartListWidget->setItem(currentRow, 5, new QTableWidgetItem(partname));
}
Expand Down