diff options
Diffstat (limited to 'win')
| -rw-r--r-- | win/common.pro | 8 | ||||
| -rw-r--r-- | win/ctype.h | 2 | ||||
| -rw-r--r-- | win/kdemacros.h | 1 | ||||
| -rw-r--r-- | win/pro_files/dcop/dcopidl/dcopidl.pro | 4 | ||||
| -rw-r--r-- | win/pro_files/tdecore/tdecore.pro | 28 | ||||
| -rw-r--r-- | win/pro_files/tdeio/tdeio.pro | 68 | ||||
| -rw-r--r-- | win/pro_files/tdemdi/test/test.pro | 2 | ||||
| -rw-r--r-- | win/qeventloopex.h | 2 | ||||
| -rw-r--r-- | win/signal.h | 2 | ||||
| -rw-r--r-- | win/stdlib.h | 2 | ||||
| -rw-r--r-- | win/string.h | 2 | ||||
| -rw-r--r-- | win/sys/fcntl.h | 2 | ||||
| -rw-r--r-- | win/sys/stat.h | 2 | ||||
| -rw-r--r-- | win/sys/types.h | 2 | ||||
| -rw-r--r-- | win/tdelibs_export_win.h | 40 | ||||
| -rw-r--r-- | win/tdemacros.h | 1 | ||||
| -rwxr-xr-x | win/tools/kmoc | 2 | ||||
| -rw-r--r-- | win/win32_utils2.cpp | 114 |
18 files changed, 149 insertions, 135 deletions
diff --git a/win/common.pro b/win/common.pro index f5c2f1af7..820246f39 100644 --- a/win/common.pro +++ b/win/common.pro @@ -3,7 +3,7 @@ # (c) 2003-2005, Jaroslaw Staniek, js@iidea.pl # -# to avoid a need for using Q_WS_WIN in C source code +# to avoid a need for using TQ_WS_WIN in C source code DEFINES += _WINDOWS WIN32_LEAN_AND_MEAN # custom definitions, options on which KDElibs do not depend @@ -141,10 +141,6 @@ contains( TEMPLATE, lib ) { } # global definitions -win32-borland { - QMAKE_CXXFLAGS += /I $(KDELIBS)/win/tdelibs_global_win.h - QMAKE_CFLAGS += /I $(KDELIBS)/win/tdelibs_global_win.h -} win32-msvc* { QMAKE_CXXFLAGS += /FI$(KDELIBS)/win/tdelibs_global_win.h QMAKE_CFLAGS += /FI$(KDELIBS)/win/tdelibs_global_win.h @@ -172,7 +168,7 @@ QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_EXCEPTIONS_ON # /GX for msvc QMAKE_LFLAGS += /FORCE:MULTIPLE # Specify that filename is a C++ source file, even if it doesn’t have -# a .cpp or .cxx extension, thus .cc files are compiled properly with msvc +# a .cpp or .cxx extension, thus files are compiled properly with msvc QMAKE_CXXFLAGS += /TP INCLUDEPATH += moc $(KDELIBS)/win $(KDELIBS) diff --git a/win/ctype.h b/win/ctype.h index 3a0f54bfc..4a5055116 100644 --- a/win/ctype.h +++ b/win/ctype.h @@ -22,8 +22,6 @@ #ifdef _MSC_VER # include <msvc/ctype.h> -#elif defined(__BORLANDC__) -# include <bcc/ctype.h> #endif #ifdef __cplusplus diff --git a/win/kdemacros.h b/win/kdemacros.h deleted file mode 100644 index c8c017b02..000000000 --- a/win/kdemacros.h +++ /dev/null @@ -1 +0,0 @@ -#include <kdemacros.h.in> diff --git a/win/pro_files/dcop/dcopidl/dcopidl.pro b/win/pro_files/dcop/dcopidl/dcopidl.pro index 2febfaa2c..df3e48a19 100644 --- a/win/pro_files/dcop/dcopidl/dcopidl.pro +++ b/win/pro_files/dcop/dcopidl/dcopidl.pro @@ -15,7 +15,7 @@ DEFINES += YY_ALWAYS_INTERACTIVE SOURCES = \ main.cpp \ -scanner.cc \ -yacc.cc +scanner.cpp \ +yacc.cpp HEADERS = diff --git a/win/pro_files/tdecore/tdecore.pro b/win/pro_files/tdecore/tdecore.pro index fbc415726..0c13e5884 100644 --- a/win/pro_files/tdecore/tdecore.pro +++ b/win/pro_files/tdecore/tdecore.pro @@ -21,15 +21,15 @@ SOURCES += \ fakes.c \ kpixmapprovider.cpp \ kpalette.cpp \ -kprocess.cpp \ -kprocio.cpp \ -kcrash.cpp \ +tdeprocess.cpp \ +tdeprocio.cpp \ +tdecrash.cpp \ kallocator.cpp \ knotifyclient.cpp \ kcompletionbase.cpp \ kcompletion.cpp \ kmimesourcefactory.cpp \ -ksimpleconfig.cpp \ +tdesimpleconfig.cpp \ libintl.cpp \ kcatalogue.cpp \ kcalendarsystem.cpp \ @@ -45,7 +45,7 @@ kurldrag.cpp \ kurl.cpp \ kidna.cpp \ kstaticdeleter.cpp \ -kstandarddirs.cpp \ +tdestandarddirs.cpp \ tdeconfig.cpp \ tdeconfigdialogmanager.cpp \ kcharsets.cpp \ @@ -68,7 +68,7 @@ tdeaccelmanager.cpp \ tdeshortcut.cpp \ tdeshortcutmenu.cpp \ tdeshortcutlist.cpp \ -kinstance.cpp \ +tdeinstance.cpp \ tdeversion.cpp \ tdelocale.cpp \ kicontheme.cpp \ @@ -76,18 +76,18 @@ kiconloader.cpp \ kiconeffect.cpp \ tdeglobalsettings.cpp \ kckey.cpp \ -kglobalaccel.cpp \ -kglobalaccel_win.cpp \ +tdeglobalaccel.cpp \ +tdeglobalaccel_win.cpp \ tdeaccelaction.cpp \ -kuniqueapplication.cpp \ +tdeuniqueapplication.cpp \ tdesycoca.cpp \ tdesycocadict.cpp \ tdesycocafactory.cpp \ tdeapplication.cpp \ kapplication_win.cpp \ -kappdcopiface.cpp \ -kprocctrl.cpp \ -kdesktopfile.cpp \ +tdeappdcopinterface.cpp \ +tdeprocctrl.cpp \ +tdedesktopfile.cpp \ kbufferedio.cpp \ netsupp_win32.cpp \ kasyncio.cpp \ @@ -128,8 +128,8 @@ kqiodevicegzip_p.cpp # generated: SOURCES += \ -kappdcopiface_stub.cpp \ -kappdcopiface_skel.cpp \ +tdeappdcopinterface_stub.cpp \ +tdeappdcopinterface_skel.cpp \ tdesycoca_stub.cpp \ tdesycoca_skel.cpp \ kdebugdcopiface_stub.cpp \ diff --git a/win/pro_files/tdeio/tdeio.pro b/win/pro_files/tdeio/tdeio.pro index 706208b2a..9d92be52c 100644 --- a/win/pro_files/tdeio/tdeio.pro +++ b/win/pro_files/tdeio/tdeio.pro @@ -102,19 +102,19 @@ tdeio/statusbarprogress.cpp \ tdeio/tcpslavebase.cpp \ tdeio/yacc.c \ \ -bookmarks/kbookmark.cc \ -bookmarks/kbookmarkbar.cc \ -bookmarks/kbookmarkdombuilder.cc \ -bookmarks/kbookmarkdrag.cc \ -bookmarks/kbookmarkexporter.cc \ -bookmarks/kbookmarkimporter.cc \ -bookmarks/kbookmarkimporter_crash.cc \ -bookmarks/kbookmarkimporter_ie.cc \ -bookmarks/kbookmarkimporter_kde1.cc \ -bookmarks/kbookmarkimporter_ns.cc \ -bookmarks/kbookmarkimporter_opera.cc \ -bookmarks/kbookmarkmanager.cc \ -bookmarks/kbookmarkmenu.cc \ +bookmarks/kbookmark.cpp \ +bookmarks/kbookmarkbar.cpp \ +bookmarks/kbookmarkdombuilder.cpp \ +bookmarks/kbookmarkdrag.cpp \ +bookmarks/kbookmarkexporter.cpp \ +bookmarks/kbookmarkimporter.cpp \ +bookmarks/kbookmarkimporter_crash.cpp \ +bookmarks/kbookmarkimporter_ie.cpp \ +bookmarks/kbookmarkimporter_kde1.cpp \ +bookmarks/kbookmarkimporter_ns.cpp \ +bookmarks/kbookmarkimporter_opera.cpp \ +bookmarks/kbookmarkmanager.cpp \ +bookmarks/kbookmarkmenu.cpp \ \ tdefile/kcombiview.cpp \ tdefile/kcustommenueditor.cpp \ @@ -154,27 +154,27 @@ tdefile/kurlrequesterdlg.cpp \ \ misc/uiserver.cpp \ \ -kssl/ksslcertdlg.cc \ -kssl/ksslinfodlg.cc \ -kssl/ksslcsessioncache.cc \ -kssl/ksslsession.cc \ -kssl/ksslsettings.cc \ -kssl/ksslcertchain.cc \ -kssl/ksslcertificate.cc \ -kssl/ksslcertificatecache.cc \ -kssl/ksslcertificatehome.cc \ -kssl/ksslcertificatefactory.cc \ -kssl/kssl.cc \ -kssl/ksslconnectioninfo.cc \ -kssl/ksslkeygen.cc \ -kssl/ksslpkcs7.cc \ -kssl/ksslpkcs12.cc \ -kssl/ksslx509v3.cc \ -kssl/ksslx509map.cc \ -kssl/ksslsigners.cc \ -kssl/ksslpeerinfo.cc \ -kssl/kopenssl.cc \ -kssl/ksmimecrypto.cc +kssl/ksslcertdlg.cpp \ +kssl/ksslinfodlg.cpp \ +kssl/ksslcsessioncache.cpp \ +kssl/ksslsession.cpp \ +kssl/ksslsettings.cpp \ +kssl/ksslcertchain.cpp \ +kssl/ksslcertificate.cpp \ +kssl/ksslcertificatecache.cpp \ +kssl/ksslcertificatehome.cpp \ +kssl/ksslcertificatefactory.cpp \ +kssl/kssl.cpp \ +kssl/ksslconnectioninfo.cpp \ +kssl/ksslkeygen.cpp \ +kssl/ksslpkcs7.cpp \ +kssl/ksslpkcs12.cpp \ +kssl/ksslx509v3.cpp \ +kssl/ksslx509map.cpp \ +kssl/ksslsigners.cpp \ +kssl/ksslpeerinfo.cpp \ +kssl/kopenssl.cpp \ +kssl/ksmimecrypto.cpp #removed tdeio/kautomount.cpp \ diff --git a/win/pro_files/tdemdi/test/test.pro b/win/pro_files/tdemdi/test/test.pro index 62b30c186..757be67fb 100644 --- a/win/pro_files/tdemdi/test/test.pro +++ b/win/pro_files/tdemdi/test/test.pro @@ -9,7 +9,7 @@ CONFIG -= windows CONFIG += debug CONFIG += console -unix:DEFINES = NO_INCLUDE_MOCFILES TQT_NO_COMPAT +unix:DEFINES = NO_INCLUDE_MOCFILES unix:LIBS += -ltdemdi -L$(TDEDIR)/lib -ltdecore -ltdeui -lDCOP -ltdeparts unix:INCLUDEPATH += . .. $(TDEDIR)/include diff --git a/win/qeventloopex.h b/win/qeventloopex.h index 648ddf228..2fed3ecf9 100644 --- a/win/qeventloopex.h +++ b/win/qeventloopex.h @@ -30,7 +30,7 @@ class QEventLoopExPrivate; class QEventLoopEx : public TQEventLoop { - Q_OBJECT + TQ_OBJECT public: QEventLoopEx( TQObject *parent = 0, const char *name = 0 ); diff --git a/win/signal.h b/win/signal.h index 571280f4b..18ebc7c27 100644 --- a/win/signal.h +++ b/win/signal.h @@ -70,8 +70,6 @@ KDEWIN32_EXPORT int kill(pid_t pid, int sig); /* regular signal.h */ #ifdef _MSC_VER # include <msvc/signal.h> -#elif defined(__BORLANDC__) -# include <bcc/signal.h> #endif #endif SIGNAL_H diff --git a/win/stdlib.h b/win/stdlib.h index 96f458b0d..3a89e468b 100644 --- a/win/stdlib.h +++ b/win/stdlib.h @@ -25,8 +25,6 @@ #ifdef _MSC_VER # include <msvc/stdlib.h> -#elif defined(__BORLANDC__) -# include <bcc/stdlib.h> #endif #define __need_size_t diff --git a/win/string.h b/win/string.h index 2ed942612..f0f301aaf 100644 --- a/win/string.h +++ b/win/string.h @@ -46,8 +46,6 @@ KDEWIN32_EXPORT char* strndup(const char *src, size_t n); /* regular string.h */ #ifdef _MSC_VER # include <msvc/string.h> -#elif defined(__BORLANDC__) -# include <bcc/string.h> #endif #endif /* KDEWIN_STRING_H */ diff --git a/win/sys/fcntl.h b/win/sys/fcntl.h index 6e5cacdbe..d3cbe7def 100644 --- a/win/sys/fcntl.h +++ b/win/sys/fcntl.h @@ -20,7 +20,5 @@ /* regular sys/fcntl.h */ #ifdef _MSC_VER # include <sys/msvc/fcntl.h> -#elif defined(__BORLANDC__) -# include <sys/bcc/fcntl.h> #endif diff --git a/win/sys/stat.h b/win/sys/stat.h index 288782032..8c99bd36a 100644 --- a/win/sys/stat.h +++ b/win/sys/stat.h @@ -28,8 +28,6 @@ /*# ifdef _INC_STAT # define _STAT_H_ # endif*/ -#elif defined(__BORLANDC__) -# include <sys/bcc/stat.h> #endif typedef short nlink_t; diff --git a/win/sys/types.h b/win/sys/types.h index 9a01fa61d..d07ec0160 100644 --- a/win/sys/types.h +++ b/win/sys/types.h @@ -23,8 +23,6 @@ /* regular types.h */ #ifdef _MSC_VER # include <sys/msvc/types.h> -#elif defined(__BORLANDC__) -# include <sys/bcc/types.h> #endif #ifndef _SIZE_T_DEFINED diff --git a/win/tdelibs_export_win.h b/win/tdelibs_export_win.h index 830eb10d9..4dae72c6c 100644 --- a/win/tdelibs_export_win.h +++ b/win/tdelibs_export_win.h @@ -26,7 +26,7 @@ #define KDE_IMPORT __declspec(dllimport) #ifdef MAKE_TDECORE_LIB -# define TDECORE_EXPORT KDE_EXPORT +# define TDECORE_EXPORT TDE_EXPORT #else # ifndef TDECORE_EXPORT # define TDECORE_EXPORT KDE_IMPORT //for apps and other libs @@ -34,15 +34,15 @@ #endif #ifdef MAKE_KDEWIN32_LIB -# define KDEWIN32_EXPORT KDE_EXPORT +# define KDEWIN32_EXPORT TDE_EXPORT #else # define KDEWIN32_EXPORT KDE_IMPORT #endif /* some classes, i.e. KDock* already use EXPORT_* macro: define it too */ #ifdef MAKE_TDEUI_LIB -# define TDEUI_EXPORT KDE_EXPORT -# define EXPORT_DOCKCLASS KDE_EXPORT +# define TDEUI_EXPORT TDE_EXPORT +# define EXPORT_DOCKCLASS TDE_EXPORT #elif KDE_MAKE_LIB # define TDEUI_EXPORT KDE_IMPORT # define EXPORT_DOCKCLASS KDE_IMPORT /* for library build export docklass by default */ @@ -52,101 +52,101 @@ #endif #ifdef MAKE_TDEFX_LIB -# define TDEFX_EXPORT KDE_EXPORT +# define TDEFX_EXPORT TDE_EXPORT #else # define TDEFX_EXPORT KDE_IMPORT #endif #ifdef MAKE_TDEPRINT_LIB -# define TDEPRINT_EXPORT KDE_EXPORT +# define TDEPRINT_EXPORT TDE_EXPORT #else # define TDEPRINT_EXPORT KDE_IMPORT #endif #ifndef TDEIO_EXPORT # ifdef MAKE_TDEIO_LIB -# define TDEIO_EXPORT KDE_EXPORT +# define TDEIO_EXPORT TDE_EXPORT # else # define TDEIO_EXPORT KDE_IMPORT # endif #endif #ifdef MAKE_DCOP_LIB -# define DCOP_EXPORT KDE_EXPORT +# define DCOP_EXPORT TDE_EXPORT #else # define DCOP_EXPORT KDE_IMPORT #endif #ifdef MAKE_TDEPARTS_LIB -# define TDEPARTS_EXPORT KDE_EXPORT +# define TDEPARTS_EXPORT TDE_EXPORT #else # define TDEPARTS_EXPORT KDE_IMPORT #endif #ifdef MAKE_KTEXTEDITOR_LIB -# define KTEXTEDITOR_EXPORT KDE_EXPORT +# define KTEXTEDITOR_EXPORT TDE_EXPORT #else # define KTEXTEDITOR_EXPORT KDE_IMPORT #endif #ifdef MAKE_KABC_LIB -# define KABC_EXPORT KDE_EXPORT +# define KABC_EXPORT TDE_EXPORT #else # define KABC_EXPORT KDE_IMPORT #endif #ifdef MAKE_KVCARD_LIB -# define KVCARD_EXPORT KDE_EXPORT +# define KVCARD_EXPORT TDE_EXPORT #else # define KVCARD_EXPORT KDE_IMPORT #endif #ifdef MAKE_TDERESOURCES_LIB -# define TDERESOURCES_EXPORT KDE_EXPORT +# define TDERESOURCES_EXPORT TDE_EXPORT #else # define TDERESOURCES_EXPORT KDE_IMPORT #endif #ifdef MAKE_TDESU_LIB -# define TDESU_EXPORT KDE_EXPORT +# define TDESU_EXPORT TDE_EXPORT #else # define TDESU_EXPORT KDE_IMPORT #endif // all TDEStyle libs #ifdef MAKE_TDESTYLE_LIB -# define TDESTYLE_EXPORT KDE_EXPORT +# define TDESTYLE_EXPORT TDE_EXPORT #else # define TDESTYLE_EXPORT KDE_IMPORT #endif #ifdef MAKE_KMDI_LIB -# define KMDI_EXPORT KDE_EXPORT +# define KMDI_EXPORT TDE_EXPORT #else # define KMDI_EXPORT KDE_IMPORT #endif #ifdef MAKE_TDEUTILS_LIB -# define TDEUTILS_EXPORT KDE_EXPORT +# define TDEUTILS_EXPORT TDE_EXPORT #else # define TDEUTILS_EXPORT KDE_IMPORT #endif #ifdef MAKE_KATEPARTINTERFACES_LIB -# define KATEPARTINTERFACES_EXPORT KDE_EXPORT +# define KATEPARTINTERFACES_EXPORT TDE_EXPORT #else # define KATEPARTINTERFACES_EXPORT KDE_IMPORT #endif #ifdef MAKE_KATEPART_LIB -# define KATEPART_EXPORT KDE_EXPORT +# define KATEPART_EXPORT TDE_EXPORT #else # define KATEPART_EXPORT KDE_IMPORT #endif #ifdef MAKE_TDEHTML_LIB -# define TDEHTML_EXPORT KDE_EXPORT +# define TDEHTML_EXPORT TDE_EXPORT #else # define TDEHTML_EXPORT KDE_IMPORT #endif diff --git a/win/tdemacros.h b/win/tdemacros.h new file mode 100644 index 000000000..da23cd9b4 --- /dev/null +++ b/win/tdemacros.h @@ -0,0 +1 @@ +#include <tdemacros.h.in> diff --git a/win/tools/kmoc b/win/tools/kmoc index 2fef8ea60..8e79c8246 100755 --- a/win/tools/kmoc +++ b/win/tools/kmoc @@ -6,7 +6,7 @@ mkdir -p moc find . -maxdepth 1 -name \*.h | while read ; do - grep Q_OBJECT $REPLY > /dev/null || continue + grep TQ_OBJECT $REPLY > /dev/null || continue moc=moc/`echo $REPLY | sed -e "s/\\.h/\\.moc/;s/\\.\\///"` if [ $moc -ot $REPLY ] ; then echo mocing $REPLY... ; moc $REPLY -o $moc ; fi done diff --git a/win/win32_utils2.cpp b/win/win32_utils2.cpp index 2e46d2acb..946d62e5a 100644 --- a/win/win32_utils2.cpp +++ b/win/win32_utils2.cpp @@ -26,51 +26,62 @@ #include <shellapi.h> #include <tchar.h> -KDEWIN32_EXPORT -TQString getWin32RegistryValue(HKEY key, const TQString& subKey, const TQString& item, bool *ok) -{ -#define FAILURE \ - { if (ok) \ - *ok = false; \ - return TQString::null; } +#define FAILURE \ + { \ + if (ok) \ + { \ + *ok = false; \ + } \ + return TQString::null; \ + } +KDEWIN32_EXPORT +TQString getWin32RegistryValue(HKEY key, const TQString &subKey, const TQString &item, bool *ok) +{ if (!subKey) + { FAILURE; + } HKEY hKey; TCHAR *lszValue; - DWORD dwType=REG_SZ; + DWORD dwType = REG_SZ; DWORD dwSize; - if (ERROR_SUCCESS!=RegOpenKeyEx(key, subKey.ucs2(), NULL, KEY_READ, &hKey)) + if (ERROR_SUCCESS != RegOpenKeyEx(key, subKey.ucs2(), NULL, KEY_READ, &hKey)) + { FAILURE; + } - if (ERROR_SUCCESS!=RegQueryValueEx(hKey, item.ucs2(), NULL, NULL, NULL, &dwSize)) + if (ERROR_SUCCESS != RegQueryValueEx(hKey, item.ucs2(), NULL, NULL, NULL, &dwSize)) + { FAILURE; + } lszValue = new TCHAR[dwSize]; - if (ERROR_SUCCESS!=RegQueryValueEx(hKey, item.ucs2(), NULL, &dwType, (LPBYTE)lszValue, &dwSize)) { - delete [] lszValue; + if (ERROR_SUCCESS != RegQueryValueEx(hKey, item.ucs2(), NULL, &dwType, (LPBYTE)lszValue, &dwSize)) + { + delete[] lszValue; FAILURE; } RegCloseKey(hKey); TQString res = TQString::fromUcs2(lszValue); - delete [] lszValue; + delete[] lszValue; return res; } KDEWIN32_EXPORT -bool showWin32FilePropertyDialog(const TQString& fileName) +bool showWin32FilePropertyDialog(const TQString &fileName) { TQString path_ = TQDir::convertSeparators(TQFileInfo(fileName).absFilePath()); SHELLEXECUTEINFO execInfo; - memset(&execInfo,0,sizeof(execInfo)); + memset(&execInfo, 0, sizeof(execInfo)); execInfo.cbSize = sizeof(execInfo); - execInfo.fMask = SEE_MASK_INVOKEIDLIST | SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI; + execInfo.fMask = SEE_MASK_INVOKEIDLIST | SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI; const TQString verb("properties"); - execInfo.lpVerb = (TCHAR*)verb.ucs2(); - execInfo.lpFile = (TCHAR*)path_.ucs2(); + execInfo.lpVerb = (TCHAR *)verb.ucs2(); + execInfo.lpFile = (TCHAR *)path_.ucs2(); return ShellExecuteEx(&execInfo); } @@ -78,77 +89,98 @@ KDEWIN32_EXPORT TQCString getWin32LocaleName() { bool ok; - TQString localeNumber = getWin32RegistryValue(HKEY_CURRENT_USER, "Control Panel\\International", - "Locale", &ok); + TQString localeNumber = getWin32RegistryValue(HKEY_CURRENT_USER, "Control Panel\\International", + "Locale", &ok); if (!ok) + { return TQCString(); - TQString localeName = getWin32RegistryValue(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layout\\DosKeybCodes", - localeNumber, &ok); + } + TQString localeName = getWin32RegistryValue(HKEY_LOCAL_MACHINE, + "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layout\\DosKeybCodes", localeNumber, + &ok); if (!ok) + { return TQCString(); + } return localeName.latin1(); } KDEWIN32_EXPORT -TQString convertKFileDialogFilterToQFileDialogFilter(const TQString& filter) +TQString convertKFileDialogFilterToQFileDialogFilter(const TQString &filter) { TQString kde_filters = filter; int pos; // Strip the escape characters from // escaped '/' characters. - TQString copy (kde_filters); + TQString copy(kde_filters); for (pos = 0; (pos = copy.find("\\/", pos)) != -1; ++pos) + { copy.remove(pos, 1); + } //<js> //we need to convert KDE filter format to Qt format //Qt format: "some text (*.first *.second)" or "All (*)" //KDE format: "*.first *.second" or "*" - TQStringList filters = TQStringList::split("\n",kde_filters); + TQStringList filters = TQStringList::split("\n", kde_filters); TQString current; TQString converted; //finally - converted filter - for (TQStringList::ConstIterator it = filters.constBegin(); it!=filters.constEnd();++it) { + for (TQStringList::ConstIterator it = filters.constBegin(); it != filters.constEnd(); ++it) + { current = *it; - TQString new_f;//filter part - TQString new_name;//filter name part + TQString new_f; //filter part + TQString new_name; //filter name part int p = (*it).find('|'); - if (p!=-1) { - new_f = current.left(p); - new_name = current.mid(p+1); + if (p != -1) + { + new_f = current.left(p); + new_name = current.mid(p + 1); } - else { - new_f = current; + else + { + new_f = current; new_name = current; //nothing better } //remove (.....) from name - p=new_name.find('('); + p = new_name.find('('); int p2 = new_name.findRev(')'); TQString new_name1, new_name2; - if (p!=-1) + if (p != -1) + { new_name1 = new_name.left(p); - if (p2!=-1) - new_name2 = new_name.mid(p2+1); + } + if (p2 != -1) + { + new_name2 = new_name.mid(p2 + 1); + } if (!new_name1.isEmpty() || !new_name2.isEmpty()) + { new_name = new_name1.stripWhiteSpace() + " " + new_name2.stripWhiteSpace(); - new_name.replace('(',""); - new_name.replace(')',""); + } + new_name.replace('(', ""); + new_name.replace(')', ""); new_name = new_name.stripWhiteSpace(); // make filters unique: remove uppercase extensions (case doesn't matter on win32, BTW) TQStringList allfiltersUnique; - TQStringList origList( TQStringList::split(" ", new_f) ); + TQStringList origList(TQStringList::split(" ", new_f)); for (TQStringList::ConstIterator it = origList.constBegin(); - it!=origList.constEnd(); ++it) + it != origList.constEnd(); ++it) { if ((*it) == (*it).lower()) + { allfiltersUnique += *it; + } } if (!converted.isEmpty()) + { converted += ";;"; + } converted += (new_name + " (" + allfiltersUnique.join(" ") + ")"); } return converted; } + |
