Commit bddce1e2 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Fixed missing callback in xtt_fileview.

parent bc947761
...@@ -84,13 +84,11 @@ void XttFileviewQtWidget::list_ok_cb(const QString& file) ...@@ -84,13 +84,11 @@ void XttFileviewQtWidget::list_ok_cb(const QString& file)
strncpy(input_text, qPrintableLatin1(file), sizeof(input_text)); strncpy(input_text, qPrintableLatin1(file), sizeof(input_text));
/* if (!streq(fileview->filetype, "")) {
if (!streq(filetype, "")) {
if (file.indexOf('.') == 0) { if (file.indexOf('.') == 0) {
strcat(input_text, filetype); strcat(input_text, fileview->filetype);
} }
} }
*/
for (int i = 0; i < fileview->filecnt; i++) { for (int i = 0; i < fileview->filecnt; i++) {
if (streq(fileview->filelist[i], input_text)) { if (streq(fileview->filelist[i], input_text)) {
...@@ -117,7 +115,6 @@ void XttFileviewQtWidget::list_ok_cb(const QString& file) ...@@ -117,7 +115,6 @@ void XttFileviewQtWidget::list_ok_cb(const QString& file)
void XttFileviewQtWidget::closeEvent(QCloseEvent* event) void XttFileviewQtWidget::closeEvent(QCloseEvent* event)
{ {
debug_print("XttFileviewQtWidget::closeEvent\n");
free(fileview->filelist); free(fileview->filelist);
delete fileview; delete fileview;
QWidget::closeEvent(event); QWidget::closeEvent(event);
...@@ -157,7 +154,6 @@ XttFileviewQt::XttFileviewQt(void* xn_parent_ctx, QWidget* xn_parent_wid, ...@@ -157,7 +154,6 @@ XttFileviewQt::XttFileviewQt(void* xn_parent_ctx, QWidget* xn_parent_wid,
} }
toplevel = new XttFileviewQtWidget(this, xn_parent_wid); toplevel = new XttFileviewQtWidget(this, xn_parent_wid);
toplevel->setToolTip(fl("xtt_fileview widget"));
toplevel->setMinimumSize(500, 500); toplevel->setMinimumSize(500, 500);
toplevel->setWindowTitle(translate_utf8(xn_title)); toplevel->setWindowTitle(translate_utf8(xn_title));
toplevel->setAttribute(Qt::WA_DeleteOnClose); toplevel->setAttribute(Qt::WA_DeleteOnClose);
...@@ -175,7 +171,7 @@ XttFileviewQt::XttFileviewQt(void* xn_parent_ctx, QWidget* xn_parent_wid, ...@@ -175,7 +171,7 @@ XttFileviewQt::XttFileviewQt(void* xn_parent_ctx, QWidget* xn_parent_wid,
} }
QObject::connect(toplevel, SIGNAL(fileSelected(const QString&)), toplevel, QObject::connect(toplevel, SIGNAL(fileSelected(const QString&)), toplevel,
SLOT(XttFileviewQtWidget::list_ok_cb(const QString&))); SLOT(list_ok_cb(const QString&)));
toplevel->exec(); toplevel->exec();
} }
\ No newline at end of file
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#ifndef xtt_fileview_qt_h #ifndef xtt_fileview_qt_h
#define xtt_fileview_qt_h #define xtt_fileview_qt_h
#include "pwr.h"
#include "xtt_fileview.h" #include "xtt_fileview.h"
#include <QFileDialog> #include <QFileDialog>
...@@ -77,6 +79,8 @@ private: ...@@ -77,6 +79,8 @@ private:
}; };
class XttFileviewQtWidget : public QFileDialog { class XttFileviewQtWidget : public QFileDialog {
Q_OBJECT
public: public:
XttFileviewQtWidget(XttFileviewQt* parent_ctx, QWidget* parent) XttFileviewQtWidget(XttFileviewQt* parent_ctx, QWidget* parent)
: QFileDialog(parent), fileview(parent_ctx) : QFileDialog(parent), fileview(parent_ctx)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment