summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/network/ftp/ftp.pro2
-rw-r--r--examples/network/ftp/sym_iap_util.h67
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qmake_generate_temp_dirs.flm22
-rw-r--r--mkspecs/symbian-sbsv2/flm/qt/qt.xml5
-rw-r--r--qmake/generators/symbian/symmake.cpp76
-rw-r--r--qmake/generators/symbian/symmake.h5
-rw-r--r--qmake/generators/symbian/symmake_abld.cpp64
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp72
8 files changed, 180 insertions, 133 deletions
diff --git a/examples/network/ftp/ftp.pro b/examples/network/ftp/ftp.pro
index 6b0f2ca..2c7389f 100644
--- a/examples/network/ftp/ftp.pro
+++ b/examples/network/ftp/ftp.pro
@@ -17,5 +17,5 @@ symbian {
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
TARGET.CAPABILITY="NetworkServices"
TARGET.UID3 = 0xA000A648
- LIBS+=-lesock # For IAP selection
+ LIBS+=-lesock -lcommdb # For IAP selection
} \ No newline at end of file
diff --git a/examples/network/ftp/sym_iap_util.h b/examples/network/ftp/sym_iap_util.h
index 928b46e..5f6e41a 100644
--- a/examples/network/ftp/sym_iap_util.h
+++ b/examples/network/ftp/sym_iap_util.h
@@ -43,9 +43,19 @@
#include <es_sock.h>
#include <es_enum.h>
+#include <commdbconnpref.h>
+
#include <sys/socket.h>
#include <net/if.h>
+_LIT(KIapNameSetting, "IAP\\Name"); // text - mandatory
+_LIT(KIapDialogPref, "IAP\\DialogPref"); // TUnit32 - optional
+_LIT(KIapService, "IAP\\IAPService"); // TUnit32 - mandatory
+_LIT(KIapServiceType, "IAP\\IAPServiceType"); // text - mandatory
+_LIT(KIapBearer, "IAP\\IAPBearer"); // TUint32 - optional
+_LIT(KIapBearerType, "IAP\\IAPBearerType"); // text - optional
+_LIT(KIapNetwork, "IAP\\IAPNetwork"); // TUint32 - optional
+
QString qt_TDesC2QStringL(const TDesC& aDescriptor)
{
#ifdef QT_NO_UNICODE
@@ -58,7 +68,9 @@ QString qt_TDesC2QStringL(const TDesC& aDescriptor)
static void qt_SetDefaultIapL()
{
TUint count;
+ TBool activeLanConnectionFound = EFalse;
TRequestStatus status;
+ TCommDbConnPref prefs;
RSocketServ serv;
CleanupClosePushL(serv);
@@ -71,41 +83,56 @@ static void qt_SetDefaultIapL()
TConnectionInfoBuf connInfo;
- _LIT(KIapNameSetting, "IAP\\Name");
- TBuf8<256> iap8Name;
+ TBuf8<256> iapName;
+ TBuf8<256> iapServiceType;
if (conn.EnumerateConnections(count) == KErrNone) {
if(count > 0) {
for (TUint i = 1; i <= count; i++) {
- // Note: GetConnectionInfo expects 1-based index.
+ // we will loop all active connections
+ // if we find one of the LAN type - will use it silently
+ // if not prompt thet user as other types
+ /// are more likely to be charged :(
if (conn.GetConnectionInfo(i, connInfo) == KErrNone) {
if (conn.Attach(connInfo, RConnection::EAttachTypeNormal) == KErrNone) {
- conn.GetDesSetting(TPtrC(KIapNameSetting), iap8Name);
- break;
+ conn.GetDesSetting(TPtrC(KIapNameSetting), iapName);
+ conn.GetDesSetting(TPtrC(KIapServiceType), iapServiceType);
+ if(iapServiceType.Find(_L8("LANService")) != KErrNotFound) {
+ activeLanConnectionFound = ETrue;
+ break;
+ }
+ // close & reopen from previous attach
+ conn.Close();
+ User::LeaveIfError(conn.Open(serv));
}
}
}
- } else {
- /*
- * no active connections yet
- * use IAP dialog to select one
- */
- User::LeaveIfError(conn.Start());
- User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iap8Name));
}
+ }
- iap8Name.ZeroTerminate();
+ if (!activeLanConnectionFound) {
+ /*
+ * no active LAN connections yet
+ * offer IAP dialog to user
+ */
+ conn.Close(); // might be opened after attach
+ User::LeaveIfError(conn.Open(serv));
+ prefs.SetDialogPreference( ECommDbDialogPrefPrompt );
+ User::LeaveIfError(conn.Start(prefs));
+ User::LeaveIfError(conn.GetDesSetting(TPtrC(KIapNameSetting), iapName));
+ }
- conn.Stop();
+ iapName.ZeroTerminate();
- struct ifreq ifReq;
- strcpy(ifReq.ifr_name, (char*)iap8Name.Ptr());
+ conn.Stop();
- User::LeaveIfError(setdefaultif(&ifReq));
+ struct ifreq ifReq;
+ strcpy(ifReq.ifr_name, (char*)iapName.Ptr());
- conn.Close();
- serv.Close();
- }
+ User::LeaveIfError(setdefaultif(&ifReq));
+
+ conn.Close();
+ serv.Close();
CleanupStack::PopAndDestroy(&conn);
CleanupStack::PopAndDestroy(&serv);
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qmake_generate_temp_dirs.flm b/mkspecs/symbian-sbsv2/flm/qt/qmake_generate_temp_dirs.flm
new file mode 100644
index 0000000..97fc6b3
--- /dev/null
+++ b/mkspecs/symbian-sbsv2/flm/qt/qmake_generate_temp_dirs.flm
@@ -0,0 +1,22 @@
+# /****************************************************************************
+# **
+# ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# ** Contact: Qt Software Information (qt-info@nokia.com)
+# **
+# ** This file is part of symbian-sbsv2 mkspec.
+# **
+# ****************************************************************************/
+
+include $(FLMHOME)/metaflm.mk
+
+SINGLETON:=$(call sanitise,TEMP_DIRS_$(EXTENSION_ROOT))
+
+ifeq ($($(SINGLETON)),)
+$(SINGLETON):=1
+$(call makepath,$(DIRS))
+$(eval $(call GenerateStandardCleanTarget,'',$(DIRS)))
+endif
+
+
+
+
diff --git a/mkspecs/symbian-sbsv2/flm/qt/qt.xml b/mkspecs/symbian-sbsv2/flm/qt/qt.xml
index a5ed141..ff12761 100644
--- a/mkspecs/symbian-sbsv2/flm/qt/qt.xml
+++ b/mkspecs/symbian-sbsv2/flm/qt/qt.xml
@@ -34,4 +34,9 @@
<param name='POST_LINK_CMD' />
<param name='LINK_TARGET' />
</interface>
+
+ <interface name="qt.qmake_generate_temp_dirs" extends="Symbian.UserFLM"
+ flm="qmake_generate_temp_dirs.flm">
+ <param name='DIRS' />
+ </interface>
</build>
diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp
index 4459a4c..374d058 100644
--- a/qmake/generators/symbian/symmake.cpp
+++ b/qmake/generators/symbian/symmake.cpp
@@ -581,8 +581,15 @@ bool SymbianMakefileGenerator::initMmpVariables() {
for(int j = 0; j < incpaths.size(); ++j) {
QString includepath = canonizePath(incpaths.at(j));
appendIfnotExist(sysincspaths, includepath);
+ // As a workaround for Symbian toolchain insistence to treat include
+ // statements as relative to source file rather than the file they appear in,
+ // we generate extra temporary include directories to make
+ // relative include paths used in various headers to work properly.
+ // Note that this is not a fix-all solution; it's just a stop-gap measure
+ // to make Qt itself build until toolchain can support relative includes in
+ // a way that Qt expects.
if (!includepath.contains(epocPath)) // No temp dirs for epoc includes
- appendIfnotExist(sysincspaths, includepath + QString("/tmp"));
+ appendIfnotExist(sysincspaths, includepath + QString("/" QT_EXTRA_INCLUDE_DIR));
}
// remove duplicate include path entries
@@ -1607,12 +1614,13 @@ QString SymbianMakefileGenerator::removeTrailingPathSeparators(QString &file)
return ret;
}
-bool SymbianMakefileGenerator::generateCleanCommands(QTextStream& t,
+void SymbianMakefileGenerator::generateCleanCommands(QTextStream& t,
const QStringList& toClean,
const QString& cmd,
const QString& cmdOptions,
const QString& itemPrefix,
- const QString& itemSuffix) {
+ const QString& itemSuffix)
+{
for (int i = 0; i < toClean.size(); ++i) {
QString item = toClean.at(i);
item.prepend(itemPrefix).append(itemSuffix);
@@ -1624,11 +1632,10 @@ bool SymbianMakefileGenerator::generateCleanCommands(QTextStream& t,
t << cmd << " " << cmdOptions << " " << QDir::toNativeSeparators(item) << "; fi" << endl;
#endif
}
-
- return true;
}
-QString SymbianMakefileGenerator::getWithoutSpecialCharacters(QString& str) {
+QString SymbianMakefileGenerator::getWithoutSpecialCharacters(QString& str)
+{
QString tmp = str;
tmp.replace(QString("/"), QString("_"));
@@ -1640,7 +1647,8 @@ QString SymbianMakefileGenerator::getWithoutSpecialCharacters(QString& str) {
return tmp;
}
-void SymbianMakefileGenerator::removeSpecialCharacters(QString& str) {
+void SymbianMakefileGenerator::removeSpecialCharacters(QString& str)
+{
str.replace(QString("/"), QString("_"));
str.replace(QString("\\"), QString("_"));
str.replace(QString("-"), QString("_"));
@@ -1648,3 +1656,57 @@ void SymbianMakefileGenerator::removeSpecialCharacters(QString& str) {
str.replace(QString("."), QString("_"));
str.replace(QString(" "), QString("_"));
}
+
+void SymbianMakefileGenerator::generateDistcleanTargets(QTextStream& t)
+{
+ t << "dodistclean:" << endl;
+ foreach(QString item, project->values("SUBDIRS")) {
+ bool fromFile = false;
+ QString fixedItem;
+ if(!project->isEmpty(item + ".file")) {
+ fixedItem = project->first(item + ".file");
+ fromFile = true;
+ } else if(!project->isEmpty(item + ".subdir")) {
+ fixedItem = project->first(item + ".subdir");
+ fromFile = false;
+ } else {
+ fromFile = item.endsWith(Option::pro_ext);
+ fixedItem = item;
+ }
+ QFileInfo fi(fileInfo(fixedItem));
+ if (!fromFile) {
+ t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fi.absoluteFilePath() + "/Makefile") << "\" dodistclean" << endl;
+ } else {
+ QString itemName = fi.fileName();
+ int extIndex = itemName.lastIndexOf(Option::pro_ext);
+ if (extIndex)
+ fixedItem = fi.absolutePath() + "/" + QString("Makefile.") + itemName.mid(0,extIndex);
+ t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fixedItem) << "\" dodistclean" << endl;
+ }
+
+ }
+
+ generatedFiles << Option::fixPathToTargetOS(fileInfo(Option::output.fileName()).absoluteFilePath()); // bld.inf
+ generatedFiles << project->values("QMAKE_INTERNAL_PRL_FILE"); // Add generated prl files for cleanup
+ generatedFiles << project->values("QMAKE_DISTCLEAN"); // Add any additional files marked for distclean
+ QStringList fixedFiles;
+ QStringList fixedDirs;
+ foreach(QString item, generatedFiles) {
+ QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
+ if (!fixedFiles.contains(fixedItem)) {
+ fixedFiles << fixedItem;
+ }
+ }
+ foreach(QString item, generatedDirs) {
+ QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
+ if (!fixedDirs.contains(fixedItem)) {
+ fixedDirs << fixedItem;
+ }
+ }
+ generateCleanCommands(t, fixedFiles, "$(DEL_FILE)", "", "", "");
+ generateCleanCommands(t, fixedDirs, "$(DEL_DIR)", "", "", "");
+ t << endl;
+
+ t << "distclean: clean dodistclean" << endl;
+ t << endl;
+} \ No newline at end of file
diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h
index 037faff..52c3c4d 100644
--- a/qmake/generators/symbian/symmake.h
+++ b/qmake/generators/symbian/symmake.h
@@ -57,6 +57,8 @@ QT_BEGIN_NAMESPACE
#define BLD_INF_FILENAME "bld.inf"
#define MAKEFILE_DEPENDENCY_SEPARATOR " \\\n\t"
+#define QT_EXTRA_INCLUDE_DIR "tmp"
+
class SymbianMakefileGenerator : public MakefileGenerator {
protected:
@@ -127,13 +129,14 @@ protected:
QString removePathSeparators(QString &file);
QString removeTrailingPathSeparators(QString &file);
- bool generateCleanCommands(QTextStream& t,
+ void generateCleanCommands(QTextStream& t,
const QStringList& toClean,
const QString& cmd,
const QString& cmdOptions,
const QString& itemPrefix,
const QString& itemSuffix);
+ void generateDistcleanTargets(QTextStream& t);
bool writeCustomDefFile();
diff --git a/qmake/generators/symbian/symmake_abld.cpp b/qmake/generators/symbian/symmake_abld.cpp
index 8501224..ccda9f2 100644
--- a/qmake/generators/symbian/symmake_abld.cpp
+++ b/qmake/generators/symbian/symmake_abld.cpp
@@ -293,11 +293,16 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
t << CREATE_TEMPS_TARGET ":" << endl;
// generate command lines like this ...
// -@ if NOT EXIST ".\somedir" mkdir ".\somedir"
+ QStringList dirsToClean;
for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
QStringList values = it.value();
for (int i = 0; i < values.size(); ++i) {
- t << "\t-@ if NOT EXIST \"" << QDir::toNativeSeparators(values.at(i)) << "\\tmp\" mkdir \""
- << QDir::toNativeSeparators(values.at(i)) << "\\tmp\"" << endl;
+ if (values.at(i).endsWith("/" QT_EXTRA_INCLUDE_DIR)) {
+ QString fixedValue(QDir::toNativeSeparators(values.at(i)));
+ dirsToClean << fixedValue;
+ t << "\t-@ if NOT EXIST \"" << fixedValue << "\" mkdir \""
+ << fixedValue << "\"" << endl;
+ }
}
}
t << endl;
@@ -305,10 +310,7 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
// Note: EXTENSION_CLEAN will get called many times when doing reallyclean
// This is why the "2> NUL" gets appended to generated clean targets in makefile.cpp.
t << EXTENSION_CLEAN ": " COMPILER_CLEAN_TARGET << endl;
- for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
- QStringList dirsToClean = it.value();
- generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_DIR"), " /S /Q ", "", "/tmp");
- }
+ generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_DIR"), " /S /Q ", "", "");
t << endl;
t << PRE_TARGETDEPS_TARGET ":"
@@ -356,56 +358,8 @@ void SymbianAbldMakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool
writeDeploymentTargets(t);
- t << "dodistclean:" << endl;
- foreach(QString item, project->values("SUBDIRS")) {
- bool fromFile = false;
- QString fixedItem;
- if(!project->isEmpty(item + ".file")) {
- fixedItem = project->first(item + ".file");
- fromFile = true;
- } else if(!project->isEmpty(item + ".subdir")) {
- fixedItem = project->first(item + ".subdir");
- fromFile = false;
- } else {
- fromFile = item.endsWith(Option::pro_ext);
- fixedItem = item;
- }
- QFileInfo fi(fileInfo(fixedItem));
- if (!fromFile) {
- t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fi.canonicalFilePath()) << "\\Makefile\" dodistclean" << endl;
- } else {
- QString itemName = fi.fileName();
- int extIndex = itemName.lastIndexOf(Option::pro_ext);
- if (extIndex)
- fixedItem = fi.canonicalPath() + "/" + QString("Makefile.") + itemName.mid(0,extIndex);
- t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fixedItem) << "\" dodistclean" << endl;
- }
-
- }
+ generateDistcleanTargets(t);
- generatedFiles << Option::fixPathToTargetOS(fileInfo(Option::output.fileName()).canonicalFilePath()); // bld.inf
- generatedFiles << project->values("QMAKE_INTERNAL_PRL_FILE"); // Add generated prl files for cleanup
- generatedFiles << project->values("QMAKE_DISTCLEAN"); // Add any additional files marked for distclean
- QStringList fixedFiles;
- QStringList fixedDirs;
- foreach(QString item, generatedFiles) {
- QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).canonicalFilePath());
- if (!fixedFiles.contains(fixedItem)) {
- fixedFiles << fixedItem;
- }
- }
- foreach(QString item, generatedDirs) {
- QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).canonicalFilePath());
- if (!fixedDirs.contains(fixedItem)) {
- fixedDirs << fixedItem;
- }
- }
- generateCleanCommands(t, fixedFiles, "$(DEL_FILE)", "", "", "");
- generateCleanCommands(t, fixedDirs, "$(DEL_DIR)", "", "", "");
- t << endl;
-
- t << "distclean: clean dodistclean" << endl;
- t << endl;
t << "clean: $(ABLD)" << endl;
t << "\t-$(ABLD)" << testClause << " reallyclean" << endl;
t << "\t-bldmake clean" << endl;
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index 7b739c7..0266bac 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -220,56 +220,8 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo
qDeleteAll(subtargets);
}
- t << "dodistclean:" << endl;
- foreach(QString item, project->values("SUBDIRS")) {
- bool fromFile = false;
- QString fixedItem;
- if(!project->isEmpty(item + ".file")) {
- fixedItem = project->first(item + ".file");
- fromFile = true;
- } else if(!project->isEmpty(item + ".subdir")) {
- fixedItem = project->first(item + ".subdir");
- fromFile = false;
- } else {
- fromFile = item.endsWith(Option::pro_ext);
- fixedItem = item;
- }
- QFileInfo fi(fileInfo(fixedItem));
- if (!fromFile) {
- t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fi.absoluteFilePath() + "/Makefile") << "\" dodistclean" << endl;
- } else {
- QString itemName = fi.fileName();
- int extIndex = itemName.lastIndexOf(Option::pro_ext);
- if (extIndex)
- fixedItem = fi.absolutePath() + "/" + QString("Makefile.") + itemName.mid(0,extIndex);
- t << "\t-$(MAKE) -f \"" << Option::fixPathToTargetOS(fixedItem) << "\" dodistclean" << endl;
- }
-
- }
+ generateDistcleanTargets(t);
- generatedFiles << Option::fixPathToTargetOS(fileInfo(Option::output.fileName()).absoluteFilePath()); // bld.inf
- generatedFiles << project->values("QMAKE_INTERNAL_PRL_FILE"); // Add generated prl files for cleanup
- generatedFiles << project->values("QMAKE_DISTCLEAN"); // Add any additional files marked for distclean
- QStringList fixedFiles;
- QStringList fixedDirs;
- foreach(QString item, generatedFiles) {
- QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
- if (!fixedFiles.contains(fixedItem)) {
- fixedFiles << fixedItem;
- }
- }
- foreach(QString item, generatedDirs) {
- QString fixedItem = Option::fixPathToTargetOS(fileInfo(item).absoluteFilePath());
- if (!fixedDirs.contains(fixedItem)) {
- fixedDirs << fixedItem;
- }
- }
- generateCleanCommands(t, fixedFiles, "$(DEL_FILE)", "", "", "");
- generateCleanCommands(t, fixedDirs, "$(DEL_DIR)", "", "", "");
- t << endl;
-
- t << "distclean: clean dodistclean" << endl;
- t << endl;
t << "clean: " << BLD_INF_FILENAME << endl;
t << "\t-$(SBS) reallyclean" << endl;
t << endl;
@@ -433,6 +385,28 @@ bool SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
t << "END" << endl;
}
+ // Generate temp dirs
+ QString tempDirs;
+ for(QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) {
+ QStringList values = it.value();
+ for (int i = 0; i < values.size(); ++i) {
+ QString value = values.at(i);
+ if (value.endsWith("/" QT_EXTRA_INCLUDE_DIR)) {
+ value = fileInfo(value).absoluteFilePath();
+ tempDirs.append(value);
+ tempDirs.append(" ");
+ }
+ }
+ }
+
+ if (tempDirs.size())
+ tempDirs.chop(1); // Remove final space
+
+ t << "START EXTENSION qt/qmake_generate_temp_dirs" << endl;
+ t << "OPTION DIRS " << tempDirs << endl;
+ t << "END" << endl;
+ t << endl;
+
t << endl;
return true;