-rw-r--r-- | core/launcher/launcher.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 767efb2..6764338 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -1089,165 +1089,172 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data) | |||
1089 | fake = TRUE; | 1089 | fake = TRUE; |
1090 | } | 1090 | } |
1091 | if (fake) { | 1091 | if (fake) { |
1092 | contents += "[Desktop Entry]\n"; | 1092 | contents += "[Desktop Entry]\n"; |
1093 | contents += "Categories = " + // No tr | 1093 | contents += "Categories = " + // No tr |
1094 | // cats.labels("Document View",doc->categories()).join(";") + "\n"; // No tr | 1094 | // cats.labels("Document View",doc->categories()).join(";") + "\n"; // No tr |
1095 | Qtopia::Record::idsToString( doc->categories() ) + "\n"; | 1095 | Qtopia::Record::idsToString( doc->categories() ) + "\n"; |
1096 | contents += "Name = "+doc->name()+"\n"; // No tr | 1096 | contents += "Name = "+doc->name()+"\n"; // No tr |
1097 | contents += "Type = "+doc->type()+"\n"; // No tr | 1097 | contents += "Type = "+doc->type()+"\n"; // No tr |
1098 | } | 1098 | } |
1099 | contents += "File = "+doc->file()+"\n"; // No tr // (resolves path) | 1099 | contents += "File = "+doc->file()+"\n"; // No tr // (resolves path) |
1100 | contents += QString("Size = %1\n").arg( fi.size() ); // No tr | 1100 | contents += QString("Size = %1\n").arg( fi.size() ); // No tr |
1101 | } | 1101 | } |
1102 | 1102 | ||
1103 | //qDebug( "sending length %d", contents.length() ); | 1103 | //qDebug( "sending length %d", contents.length() ); |
1104 | #ifndef QT_NO_COP | 1104 | #ifndef QT_NO_COP |
1105 | QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); | 1105 | QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); |
1106 | e << contents; | 1106 | e << contents; |
1107 | #endif | 1107 | #endif |
1108 | 1108 | ||
1109 | //qDebug( "================ \n\n%s\n\n===============", | 1109 | //qDebug( "================ \n\n%s\n\n===============", |
1110 | //contents.latin1() ); | 1110 | //contents.latin1() ); |
1111 | 1111 | ||
1112 | delete docsFolder; | 1112 | delete docsFolder; |
1113 | docsFolder = 0; | 1113 | docsFolder = 0; |
1114 | #ifdef QWS | 1114 | #ifdef QWS |
1115 | } else if ( msg == "setMouseProto(QString)" ) { | 1115 | } else if ( msg == "setMouseProto(QString)" ) { |
1116 | QString mice; | 1116 | QString mice; |
1117 | stream >> mice; | 1117 | stream >> mice; |
1118 | setenv("QWS_MOUSE_PROTO",mice.latin1(),1); | 1118 | setenv("QWS_MOUSE_PROTO",mice.latin1(),1); |
1119 | qwsServer->openMouse(); | 1119 | qwsServer->openMouse(); |
1120 | } else if ( msg == "setKeyboard(QString)" ) { | 1120 | } else if ( msg == "setKeyboard(QString)" ) { |
1121 | QString kb; | 1121 | QString kb; |
1122 | stream >> kb; | 1122 | stream >> kb; |
1123 | setenv("QWS_KEYBOARD",kb.latin1(),1); | 1123 | setenv("QWS_KEYBOARD",kb.latin1(),1); |
1124 | qwsServer->openKeyboard(); | 1124 | qwsServer->openKeyboard(); |
1125 | #endif | 1125 | #endif |
1126 | } | 1126 | } |
1127 | } | 1127 | } |
1128 | 1128 | ||
1129 | void Launcher::cancelSync() | 1129 | void Launcher::cancelSync() |
1130 | { | 1130 | { |
1131 | #ifndef QT_NO_COP | 1131 | #ifndef QT_NO_COP |
1132 | QCopEnvelope e( "QPE/Desktop", "cancelSync()" ); | 1132 | QCopEnvelope e( "QPE/Desktop", "cancelSync()" ); |
1133 | #endif | 1133 | #endif |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | void Launcher::launcherMessage( const QCString &msg, const QByteArray &data) | 1136 | void Launcher::launcherMessage( const QCString &msg, const QByteArray &data) |
1137 | { | 1137 | { |
1138 | QDataStream stream( data, IO_ReadOnly ); | 1138 | QDataStream stream( data, IO_ReadOnly ); |
1139 | if ( msg == "setTabView(QString,int)" ) { | 1139 | if ( msg == "setTabView(QString,int)" ) { |
1140 | QString id; | 1140 | QString id; |
1141 | stream >> id; | 1141 | stream >> id; |
1142 | int mode; | 1142 | int mode; |
1143 | stream >> mode; | 1143 | stream >> mode; |
1144 | if ( tabs->view(id) ) | 1144 | if ( tabs->view(id) ) |
1145 | tabs->view(id)->setViewMode( (LauncherView::ViewMode)mode ); | 1145 | tabs->view(id)->setViewMode( (LauncherView::ViewMode)mode ); |
1146 | } else if ( msg == "setTabBackground(QString,int,QString)" ) { | 1146 | } else if ( msg == "setTabBackground(QString,int,QString)" ) { |
1147 | QString id; | 1147 | QString id; |
1148 | stream >> id; | 1148 | stream >> id; |
1149 | int mode; | 1149 | int mode; |
1150 | stream >> mode; | 1150 | stream >> mode; |
1151 | QString pixmapOrColor; | 1151 | QString pixmapOrColor; |
1152 | stream >> pixmapOrColor; | 1152 | stream >> pixmapOrColor; |
1153 | if ( tabs->view(id) ) | 1153 | if ( tabs->view(id) ) |
1154 | tabs->view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); | 1154 | tabs->view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); |
1155 | } else if ( msg == "setTextColor(QString,QString)" ) { | 1155 | } else if ( msg == "setTextColor(QString,QString)" ) { |
1156 | QString id; | 1156 | QString id; |
1157 | stream >> id; | 1157 | stream >> id; |
1158 | QString color; | 1158 | QString color; |
1159 | stream >> color; | 1159 | stream >> color; |
1160 | if ( tabs->view(id) ) | 1160 | if ( tabs->view(id) ) |
1161 | tabs->view(id)->setTextColor( QColor(color) ); | 1161 | tabs->view(id)->setTextColor( QColor(color) ); |
1162 | } else if ( msg == "setFont(QString,QString,int,int,int)" ) { | 1162 | } else if ( msg == "setFont(QString,QString,int,int,int)" ) { |
1163 | QString id; | 1163 | QString id; |
1164 | stream >> id; | 1164 | stream >> id; |
1165 | QString fam; | 1165 | QString fam; |
1166 | stream >> fam; | 1166 | stream >> fam; |
1167 | int size; | 1167 | int size; |
1168 | stream >> size; | 1168 | stream >> size; |
1169 | int weight; | 1169 | int weight; |
1170 | stream >> weight; | 1170 | stream >> weight; |
1171 | int italic; | 1171 | int italic; |
1172 | stream >> italic; | 1172 | stream >> italic; |
1173 | if ( tabs->view(id) ) | 1173 | if ( tabs->view(id) ) |
1174 | if ( !fam. isEmpty ( )) | 1174 | if ( !fam. isEmpty ( )) |
1175 | tabs->view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); | 1175 | tabs->view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); |
1176 | else | 1176 | else |
1177 | tabs->view(id)->unsetViewFont(); | 1177 | tabs->view(id)->unsetViewFont(); |
1178 | qDebug( "setFont: %s, %d, %d, %d", fam.latin1(), size, weight, italic ); | 1178 | qDebug( "setFont: %s, %d, %d, %d", fam.latin1(), size, weight, italic ); |
1179 | } | 1179 | } |
1180 | else if ( msg == "setBusyIndicatorType(QString)" ) { | 1180 | else if ( msg == "setBusyIndicatorType(QString)" ) { |
1181 | QString type; | 1181 | QString type; |
1182 | stream >> type; | 1182 | stream >> type; |
1183 | tabs->setBusyIndicatorType(type); | 1183 | tabs->setBusyIndicatorType(type); |
1184 | } | 1184 | } |
1185 | else if ( msg == "home()" ) { | ||
1186 | if ( isVisibleWindow( winId ( ))) | ||
1187 | nextView ( ); | ||
1188 | else | ||
1189 | raise ( ); | ||
1190 | |||
1191 | } | ||
1185 | } | 1192 | } |
1186 | 1193 | ||
1187 | void Launcher::storageChanged() | 1194 | void Launcher::storageChanged() |
1188 | { | 1195 | { |
1189 | if ( in_lnk_props ) { | 1196 | if ( in_lnk_props ) { |
1190 | got_lnk_change = TRUE; | 1197 | got_lnk_change = TRUE; |
1191 | lnk_change = QString::null; | 1198 | lnk_change = QString::null; |
1192 | } else { | 1199 | } else { |
1193 | updateLink( QString::null ); | 1200 | updateLink( QString::null ); |
1194 | } | 1201 | } |
1195 | } | 1202 | } |
1196 | 1203 | ||
1197 | 1204 | ||
1198 | bool Launcher::mkdir(const QString &localPath) | 1205 | bool Launcher::mkdir(const QString &localPath) |
1199 | { | 1206 | { |
1200 | QDir fullDir(localPath); | 1207 | QDir fullDir(localPath); |
1201 | if (fullDir.exists()) | 1208 | if (fullDir.exists()) |
1202 | return true; | 1209 | return true; |
1203 | 1210 | ||
1204 | // at this point the directory doesn't exist | 1211 | // at this point the directory doesn't exist |
1205 | // go through the directory tree and start creating the direcotories | 1212 | // go through the directory tree and start creating the direcotories |
1206 | // that don't exist; if we can't create the directories, return false | 1213 | // that don't exist; if we can't create the directories, return false |
1207 | 1214 | ||
1208 | QString dirSeps = "/"; | 1215 | QString dirSeps = "/"; |
1209 | int dirIndex = localPath.find(dirSeps); | 1216 | int dirIndex = localPath.find(dirSeps); |
1210 | QString checkedPath; | 1217 | QString checkedPath; |
1211 | 1218 | ||
1212 | // didn't find any seps; weird, use the cur dir instead | 1219 | // didn't find any seps; weird, use the cur dir instead |
1213 | if (dirIndex == -1) { | 1220 | if (dirIndex == -1) { |
1214 | //qDebug("No seperators found in path %s", localPath.latin1()); | 1221 | //qDebug("No seperators found in path %s", localPath.latin1()); |
1215 | checkedPath = QDir::currentDirPath(); | 1222 | checkedPath = QDir::currentDirPath(); |
1216 | } | 1223 | } |
1217 | 1224 | ||
1218 | while (checkedPath != localPath) { | 1225 | while (checkedPath != localPath) { |
1219 | // no more seperators found, use the local path | 1226 | // no more seperators found, use the local path |
1220 | if (dirIndex == -1) | 1227 | if (dirIndex == -1) |
1221 | checkedPath = localPath; | 1228 | checkedPath = localPath; |
1222 | else { | 1229 | else { |
1223 | // the next directory to check | 1230 | // the next directory to check |
1224 | checkedPath = localPath.left(dirIndex) + "/"; | 1231 | checkedPath = localPath.left(dirIndex) + "/"; |
1225 | // advance the iterator; the next dir seperator | 1232 | // advance the iterator; the next dir seperator |
1226 | dirIndex = localPath.find(dirSeps, dirIndex+1); | 1233 | dirIndex = localPath.find(dirSeps, dirIndex+1); |
1227 | } | 1234 | } |
1228 | 1235 | ||
1229 | QDir checkDir(checkedPath); | 1236 | QDir checkDir(checkedPath); |
1230 | if (!checkDir.exists()) { | 1237 | if (!checkDir.exists()) { |
1231 | //qDebug("mkdir making dir %s", checkedPath.latin1()); | 1238 | //qDebug("mkdir making dir %s", checkedPath.latin1()); |
1232 | 1239 | ||
1233 | if (!checkDir.mkdir(checkedPath)) { | 1240 | if (!checkDir.mkdir(checkedPath)) { |
1234 | qDebug("Unable to make directory %s", checkedPath.latin1()); | 1241 | qDebug("Unable to make directory %s", checkedPath.latin1()); |
1235 | return FALSE; | 1242 | return FALSE; |
1236 | } | 1243 | } |
1237 | } | 1244 | } |
1238 | 1245 | ||
1239 | } | 1246 | } |
1240 | return TRUE; | 1247 | return TRUE; |
1241 | } | 1248 | } |
1242 | 1249 | ||
1243 | void Launcher::preloadApps() | 1250 | void Launcher::preloadApps() |
1244 | { | 1251 | { |
1245 | Config cfg("Launcher"); | 1252 | Config cfg("Launcher"); |
1246 | cfg.setGroup("Preload"); | 1253 | cfg.setGroup("Preload"); |
1247 | QStringList apps = cfg.readListEntry("Apps",','); | 1254 | QStringList apps = cfg.readListEntry("Apps",','); |
1248 | for (QStringList::ConstIterator it=apps.begin(); it!=apps.end(); ++it) { | 1255 | for (QStringList::ConstIterator it=apps.begin(); it!=apps.end(); ++it) { |
1249 | #ifndef QT_NO_COP | 1256 | #ifndef QT_NO_COP |
1250 | QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()"); | 1257 | QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()"); |
1251 | #endif | 1258 | #endif |
1252 | } | 1259 | } |
1253 | } | 1260 | } |