Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
7c649e4a
Commit
7c649e4a
authored
Jul 23, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first draft for fixing 738
parent
c7abe505
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
29 deletions
+10
-29
UBApplicationController.cpp
src/core/UBApplicationController.cpp
+9
-26
UBApplicationController.h
src/core/UBApplicationController.h
+1
-3
No files found.
src/core/UBApplicationController.cpp
View file @
7c649e4a
...
...
@@ -63,7 +63,6 @@ UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBo
,
mControlView
(
pControlView
)
,
mDisplayView
(
pDisplayView
)
,
mMirror
(
0
)
,
mFtp
(
0
)
,
mMainMode
(
Board
)
,
mDisplayManager
(
0
)
,
mAutomaticCheckForUpdates
(
false
)
...
...
@@ -120,7 +119,6 @@ UBApplicationController::~UBApplicationController()
delete
mBlackScene
;
delete
mMirror
;
if
(
mFtp
)
delete
mFtp
;
if
(
mHttp
)
delete
mHttp
;
}
...
...
@@ -521,42 +519,27 @@ void UBApplicationController::showSankoreEditor()
emit
mainModeChanged
(
mMainMode
);
}
void
UBApplicationController
::
runCheckUpdate
(
int
id
,
bool
error
)
{
Q_UNUSED
(
id
);
if
(
!
error
){
if
(
mFtp
!=
NULL
)
delete
mFtp
;
mFtp
=
new
QFtp
(
this
);
connect
(
mFtp
,
SIGNAL
(
commandFinished
(
int
,
bool
)),
this
,
SLOT
(
ftpCommandFinished
(
int
,
bool
)));
mFtp
->
connectToHost
(
"91.121.248.138"
,
21
);
mFtp
->
login
(
"anonymous"
,
"anonymous"
);
mFtp
->
get
(
"update.json"
,
0
);
}
}
void
UBApplicationController
::
checkUpdate
()
{
//TODO change this when upgrade the qt version
// networkAccessible : NetworkAccessibility not yet available
if
(
mHttp
)
if
(
mHttp
)
delete
mHttp
;
QUrl
url
(
"http://
www.google.com
"
);
QUrl
url
(
"http://
ftp.open-sankore.org/update.json
"
);
mHttp
=
new
QHttp
(
url
.
host
());
connect
(
mHttp
,
SIGNAL
(
requestFinished
(
int
,
bool
)),
this
,
SLOT
(
runCheckUpdate
(
int
,
bool
)));
connect
(
mHttp
,
SIGNAL
(
requestFinished
(
int
,
bool
)),
this
,
SLOT
(
updateRequestFinished
(
int
,
bool
)));
mHttp
->
get
(
url
.
path
());
}
void
UBApplicationController
::
ftpCommand
Finished
(
int
id
,
bool
error
)
void
UBApplicationController
::
updateRequest
Finished
(
int
id
,
bool
error
)
{
if
(
error
){
qWarning
()
<<
"
ftp command id"
<<
id
<<
"return the error: "
<<
mF
tp
->
errorString
();
m
F
tp
->
close
();
qWarning
()
<<
"
http command id"
<<
id
<<
"return the error: "
<<
mHt
tp
->
errorString
();
m
Ht
tp
->
close
();
}
else
{
QString
responseString
=
QString
(
mFtp
->
readAll
());
QString
responseString
=
QString
(
mHttp
->
readAll
());
qDebug
()
<<
responseString
;
if
(
!
responseString
.
isEmpty
()
&&
responseString
.
contains
(
"version"
)
&&
responseString
.
contains
(
"url"
)){
m
F
tp
->
close
();
m
Ht
tp
->
close
();
downloadJsonFinished
(
responseString
);
}
}
...
...
src/core/UBApplicationController.h
View file @
7c649e4a
...
...
@@ -134,8 +134,7 @@ class UBApplicationController : public QObject
void
checkUpdateAtLaunch
();
private
slots
:
void
ftpCommandFinished
(
int
id
,
bool
error
);
void
runCheckUpdate
(
int
id
,
bool
error
);
void
updateRequestFinished
(
int
id
,
bool
error
);
protected
:
...
...
@@ -152,7 +151,6 @@ class UBApplicationController : public QObject
UBScreenMirror
*
mMirror
;
int
mInitialHScroll
,
mInitialVScroll
;
QFtp
*
mFtp
;
private
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment