Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
549022b5
Commit
549022b5
authored
Jan 10, 2011
by
Christian Kandeler
Browse files
Maemo: Tell file manager not to bother the user with expected updates.
parent
7e0c289e
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt-maemo/maemodeployablelistmodel.cpp
View file @
549022b5
...
...
@@ -230,6 +230,7 @@ bool MaemoDeployableListModel::addDesktopFile(QString &error)
return
true
;
const
QString
desktopFilePath
=
QFileInfo
(
m_proFilePath
).
path
()
+
QLatin1Char
(
'/'
)
+
m_projectName
+
QLatin1String
(
".desktop"
);
MaemoGlobal
::
FileUpdate
update
(
desktopFilePath
);
QFile
desktopFile
(
desktopFilePath
);
const
bool
existsAlready
=
desktopFile
.
exists
();
if
(
!
desktopFile
.
open
(
QIODevice
::
ReadWrite
))
{
...
...
@@ -316,6 +317,7 @@ QString MaemoDeployableListModel::remoteIconFilePath() const
bool
MaemoDeployableListModel
::
addLinesToProFile
(
const
QStringList
&
lines
)
{
QFile
projectFile
(
m_proFilePath
);
MaemoGlobal
::
FileUpdate
update
(
m_proFilePath
);
if
(
!
projectFile
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Append
))
{
qWarning
(
"Error opening .pro file for writing."
);
return
false
;
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp
View file @
549022b5
...
...
@@ -36,6 +36,7 @@
#include "maemoconstants.h"
#include "maemodeviceconfigurations.h"
#include <coreplugin/filemanager.h>
#include <coreplugin/ssh/sshconnection.h>
#include <qt4projectmanager/qtversionmanager.h>
#include <utils/environment.h>
...
...
@@ -212,5 +213,16 @@ bool MaemoGlobal::callMaddeShellScript(QProcess &proc, const QString &maddeRoot,
return
true
;
}
MaemoGlobal
::
FileUpdate
::
FileUpdate
(
const
QString
&
fileName
)
:
m_fileName
(
fileName
)
{
Core
::
FileManager
::
instance
()
->
expectFileChange
(
fileName
);
}
MaemoGlobal
::
FileUpdate
::~
FileUpdate
()
{
Core
::
FileManager
::
instance
()
->
unexpectFileChange
(
m_fileName
);
}
}
// namespace Internal
}
// namespace Qt4ProjectManager
src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h
View file @
549022b5
...
...
@@ -63,6 +63,14 @@ class MaemoGlobal
public:
enum
MaemoVersion
{
Maemo5
,
Maemo6
};
class
FileUpdate
{
public:
FileUpdate
(
const
QString
&
fileName
);
~
FileUpdate
();
private:
const
QString
m_fileName
;
};
static
QString
homeDirOnDevice
(
const
QString
&
uname
);
static
QString
remoteSudo
();
static
QString
remoteCommandPrefix
(
const
QString
&
commandFilePath
);
...
...
src/plugins/qt4projectmanager/qt-maemo/maemotemplatesmanager.cpp
View file @
549022b5
...
...
@@ -458,8 +458,10 @@ QString MaemoTemplatesManager::version(const Project *project,
bool
MaemoTemplatesManager
::
setVersion
(
const
Project
*
project
,
const
QString
&
version
,
QString
*
error
)
const
{
const
QString
filePath
=
changeLogFilePath
(
project
);
MaemoGlobal
::
FileUpdate
update
(
filePath
);
QSharedPointer
<
QFile
>
changeLog
=
openFile
(
changeLogFilePath
(
project
)
,
QIODevice
::
ReadWrite
,
error
);
=
openFile
(
filePath
,
QIODevice
::
ReadWrite
,
error
);
if
(
!
changeLog
)
return
false
;
...
...
@@ -496,8 +498,10 @@ QIcon MaemoTemplatesManager::packageManagerIcon(const Project *project,
bool
MaemoTemplatesManager
::
setPackageManagerIcon
(
const
Project
*
project
,
const
QString
&
iconFilePath
,
QString
*
error
)
const
{
const
QString
filePath
=
controlFilePath
(
project
);
MaemoGlobal
::
FileUpdate
update
(
filePath
);
const
QSharedPointer
<
QFile
>
controlFile
=
openFile
(
controlFilePath
(
project
)
,
QIODevice
::
ReadWrite
,
error
);
=
openFile
(
filePath
,
QIODevice
::
ReadWrite
,
error
);
if
(
!
controlFile
)
return
false
;
const
QPixmap
pixmap
(
iconFilePath
);
...
...
@@ -577,6 +581,7 @@ bool MaemoTemplatesManager::setFieldValue(const Project *project,
const
QByteArray
&
fieldName
,
const
QByteArray
&
fieldValue
)
{
QFile
controlFile
(
controlFilePath
(
project
));
MaemoGlobal
::
FileUpdate
update
(
controlFile
.
fileName
());
if
(
!
controlFile
.
open
(
QIODevice
::
ReadWrite
))
return
false
;
QByteArray
contents
=
controlFile
.
readAll
();
...
...
Write
Preview
Supports
Markdown
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