Skip to content
This repository has been archived by the owner on Nov 15, 2020. It is now read-only.

Commit

Permalink
将源码移动到src文件夹
Browse files Browse the repository at this point in the history
  • Loading branch information
jing332 committed Aug 13, 2020
1 parent 3238ad9 commit f000c6d
Show file tree
Hide file tree
Showing 94 changed files with 73 additions and 114 deletions.
19 changes: 9 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*.user
/cgoqt/*.exe
/cgoqt/*.a
/cgoqt/*.dll
/cgoqt/download
/cgoqt/.idea
*.user
*.exe
*.a
*.dll
/src/cgoqt/download
/src/cgoqt/.idea
/.qmake.stash
/cgoqt/*.log
/cgoqt/config.json
/cgoqt/xmlydownloader.h
/cgoqt/xmlydownloader.a
/src/cgoqt/*.log
/src/cgoqt/config.json
/src/cgoqt/xmlydownloader.h
74 changes: 0 additions & 74 deletions main.cpp

This file was deleted.

File renamed without changes.
2 changes: 2 additions & 0 deletions cgoqt/build.bat → src/cgoqt/build.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
set GOARCH=386
set CGO_ENABLED=1
go build -buildmode=c-archive
pause
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <QApplication>
#include <QDateTime>
#include <QDebug>
#include <QFile>
#include <QMetaType>

#include "appevent.h"
#include "cgoqt/cgo.h"
#include "ui/mainwindow.h"
#include "xmlydownloader.h"

void OnUpdateFileLength(int id, long *contentLength, long *currentLength) {
emit AppEvent::getInstance()->UpdateFileLength(id, contentLength,
currentLength);
}

MainWindow *win;
int main(int argc, char *argv[]) {
CgoRegisterCallback(OnUpdateFileLength);
QApplication a(argc, argv);
win = new MainWindow();
win->show();

return a.exec();
}
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <QRandomGenerator>
#include <QThread>

#include "cgoqt/xmlydownloader.h"
#include "xmlydownloader.h"

DownloadRunnable::DownloadRunnable(int id, const QString &url,
const QString &filePath)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "downloadvipfilerunnable.h"

#include "cgoqt/xmlydownloader.h"
#include "xmlydownloader.h"

DownloadVipFileRunnable::DownloadVipFileRunnable(int trackID,
const QString &cookie,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <QObject>
#include <QRunnable>

#include "cgoqt/xmlydownloader.h"
#include "type.h"
#include "xmlydownloader.h"

class DownloadVipFileRunnable : public QObject, public QRunnable {
Q_OBJECT
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <QObject>
#include <QRunnable>

#include "cgoqt/xmlydownloader.h"
#include "xmlydownloader.h"

class GetAlbumInfoRunnable : public QObject, public QRunnable {
Q_OBJECT
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <QObject>
#include <QRunnable>

#include "cgoqt/xmlydownloader.h"
#include "xmlydownloader.h"
#include "type.h"

class GetAudioInfoRunnable : public QObject, public QRunnable {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <QObject>
#include <QRunnable>

#include "cgoqt/xmlydownloader.h"
#include "xmlydownloader.h"

class GetUserInfoRunnable : public QObject, public QRunnable {
Q_OBJECT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <QObject>
#include <QRunnable>

#include "cgoqt/xmlydownloader.h"
#include "xmlydownloader.h"
#include "type.h"

class GetVipAudioInfoRunnable : public QObject, public QRunnable {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion ui/cookieinputdialog.cpp → src/ui/cookieinputdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <QDebug>
#include <QThreadPool>

#include "runnable/getuserinforunnable.h"
#include "runnables/getuserinforunnable.h"
#include "ui_cookieinputdialog.h"

CookieInputDialog::CookieInputDialog(const QString &cookie, QWidget *parent)
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions ui/downloadqueuedialog.cpp → src/ui/downloadqueuedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <QMessageBox>

#include "appevent.h"
#include "runnable/downloadrunnable.h"
#include "runnable/downloadvipfilerunnable.h"
#include "runnables/downloadrunnable.h"
#include "runnables/downloadvipfilerunnable.h"
#include "ui/mainwindow.h"

DownloadQueueDialog::DownloadQueueDialog(const QString &cookie, QWidget *parent)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions ui/mainwindow.cpp → src/ui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <QTextEdit>

#include "cookieinputdialog.h"
#include "runnable/getalbuminforunnable.h"
#include "runnable/getaudioinforunnable.h"
#include "runnables/getalbuminforunnable.h"
#include "runnables/getaudioinforunnable.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
Expand Down
2 changes: 1 addition & 1 deletion ui/mainwindow.h → src/ui/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <QThreadPool>
#include <QTimer>

#include "cgoqt/xmlydownloader.h"
#include "xmlydownloader.h"
#include "downloadqueuedialog.h"
#include "type.h"

Expand Down
File renamed without changes.
41 changes: 24 additions & 17 deletions xmly-downloader-qt5.pro → src/xmly-downloader-qt5.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ TARGET = xmly-downloader-qt5
TEMPLATE = app
CONFIG += c++11

LIBS += $$PWD/cgoqt/xmlydownloader.a
macx {
LIBS += -framework Security
}

INCLUDEPATH += $$PWD/include $$PWD/cgoqt

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
Expand All @@ -19,27 +26,26 @@ DEFINES += QT_DEPRECATED_WARNINGS

SOURCES += \
main.cpp \
runnable/downloadrunnable.cpp \
runnable/downloadvipfilerunnable.cpp \
runnable/getalbuminforunnable.cpp \
runnable/getaudioinforunnable.cpp \
runnable/getuserinforunnable.cpp \
runnable/getvipaudioinforunnable.cpp \
runnables/downloadrunnable.cpp \
runnables/downloadvipfilerunnable.cpp \
runnables/getalbuminforunnable.cpp \
runnables/getaudioinforunnable.cpp \
runnables/getuserinforunnable.cpp \
runnables/getvipaudioinforunnable.cpp \
ui/cookieinputdialog.cpp \
ui/downloadqueuedialog.cpp \
ui/downloadtaskitemwidget.cpp \
ui/mainwindow.cpp

HEADERS += \
appevent.h \
main.h \
runnable/downloadrunnable.h \
runnable/downloadvipfilerunnable.h \
runnable/getalbuminforunnable.h \
runnable/getaudioinforunnable.h \
runnable/getuserinforunnable.h \
runnable/getvipaudioinforunnable.h \
type.h \
appevent.h \
runnables/downloadrunnable.h \
runnables/downloadvipfilerunnable.h \
runnables/getalbuminforunnable.h \
runnables/getaudioinforunnable.h \
runnables/getuserinforunnable.h \
runnables/getvipaudioinforunnable.h \
ui/cookieinputdialog.h \
ui/downloadqueuedialog.h \
ui/downloadtaskitemwidget.h \
Expand All @@ -56,7 +62,8 @@ FORMS += \
ui/mainwindow.ui

RESOURCES += \
res/xmly-downloader-qt5.qrc \
res/qss.qrc
resouces/qss.qrc \
resouces/xmly-downloader-qt5.qrc

LIBS += -L$$PWD/cgoqt $$PWD/cgoqt/xmlydownloader.a
DISTFILES += \
resouces/ximalaya.ico

0 comments on commit f000c6d

Please sign in to comment.