ktigcc-obsolete-kde.diff 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. diff -ur ktigcc/ktigcc.cpp ktigcc-obsolete-kde/ktigcc.cpp
  2. --- ktigcc/ktigcc.cpp 2007-10-09 21:36:50.000000000 +0200
  3. +++ ktigcc-obsolete-kde/ktigcc.cpp 2008-04-28 02:49:41.000000000 +0200
  4. @@ -39,8 +39,8 @@
  5. #include "mainform.h"
  6. // Check for KDE version at compile time to avoid wasting users' time
  7. -#if KDE_VERSION < KDE_MAKE_VERSION(3,5,7)
  8. -#error KDE 3.5.7 or higher required
  9. +#if KDE_VERSION < KDE_MAKE_VERSION(3,5,2)
  10. +#error KDE 3.5.2 or higher required
  11. #endif
  12. using namespace std;
  13. @@ -78,8 +78,8 @@
  14. QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
  15. // Check for KDE version
  16. - if (KDE::version() < KDE_MAKE_VERSION(3,5,7))
  17. - qFatal("KDE 3.5.7 or higher required");
  18. + if (KDE::version() < KDE_MAKE_VERSION(3,5,2))
  19. + qFatal("KDE 3.5.2 or higher required");
  20. KAboutData about("ktigcc","TIGCC IDE for KDE","1.09",
  21. "TIGCC C and ASM SDK", KAboutData::License_GPL,
  22. diff -ur ktigcc/preferences.cpp ktigcc-obsolete-kde/preferences.cpp
  23. --- ktigcc/preferences.cpp 2007-10-09 21:36:50.000000000 +0200
  24. +++ ktigcc-obsolete-kde/preferences.cpp 2008-04-28 02:48:23.000000000 +0200
  25. @@ -44,12 +44,36 @@
  26. // versions of the syntax highlighting description file:
  27. // 1.00 = KTIGCC 20060807 Beta
  28. -// 1.01 = KTIGCC 20060814 Beta - 1.07
  29. -// 1.02 = current KTIGCC 1 (since 1.08)
  30. -#define CURRENT_SYNFILE_VERSION "1.02"
  31. +// 1.01 = current
  32. +#define CURRENT_SYNFILE_VERSION "1.01"
  33. TIGCCPrefs preferences;
  34. +static void genAllCaseVariants(QString keyword, unsigned pos,
  35. + QStringList &stringList)
  36. +{
  37. + // WARNING: Exponential complexity in the keyword length. Yuck!
  38. + // Blame Kate's lack of flexibility.
  39. + // Also note that this just LOOKS like a functional recursion, there ARE side
  40. + // effects.
  41. + QChar c=keyword[pos];
  42. + if (c.isNull())
  43. + stringList.append(keyword);
  44. + else {
  45. + QChar upper=c.upper();
  46. + QChar lower=c.lower();
  47. + if (lower==upper)
  48. + genAllCaseVariants(keyword,pos+1,stringList);
  49. + else {
  50. + keyword[pos]=upper;
  51. + genAllCaseVariants(keyword,pos+1,stringList);
  52. + keyword[pos]=lower;
  53. + genAllCaseVariants(keyword,pos+1,stringList);
  54. + keyword[pos]=c;
  55. + }
  56. + }
  57. +}
  58. +
  59. static void writeSyntaxXML(const Syn_SettingsForDoc &synprefs,
  60. const QString &name, const QString &internalName)
  61. {
  62. @@ -95,7 +119,23 @@
  63. const Syn_WordList &wordList=*it;
  64. CHILD_NODE(list,highlighting,"list");
  65. ADD_ATTR(list,"name",wordList.name);
  66. - QStringList stringList=wordList.list;
  67. + QStringList stringList;
  68. + if (wordList.caseSensitive || allWordListsCaseInsensitive)
  69. + stringList=wordList.list;
  70. + else {
  71. + // This is really ugly. Why can't Kate allow me to specify
  72. + // case-sensitivity per word list?
  73. + for (QStringList::ConstIterator it=wordList.list.begin();
  74. + it!=wordList.list.end(); ++it) {
  75. + const QString &keyword=*it;
  76. + // This is bad, but I need to cap time, memory and disk space
  77. + // requirements somewhere.
  78. + if (keyword.length()<=10)
  79. + genAllCaseVariants(keyword,0,stringList);
  80. + else
  81. + stringList.append(keyword);
  82. + }
  83. + }
  84. for (QStringList::ConstIterator it=stringList.begin(); it!=stringList.end();
  85. ++it) {
  86. const QString &keyword=*it;
  87. @@ -155,8 +195,6 @@
  88. ADD_ATTR(detectWordList,"attribute",wordList.name);
  89. ADD_ATTR(detectWordList,"context","#stay");
  90. ADD_ATTR(detectWordList,"String",wordList.name);
  91. - if (!(wordList.caseSensitive || allWordListsCaseInsensitive))
  92. - ADD_ATTR(detectWordList,"insensitive","true");
  93. }
  94. CHILD_NODE(numFloat,defaultContext,"Float");
  95. ADD_ATTR(numFloat,"attribute","Number");