void MainWindow::slotDisplayPackageInfo( QListViewItem *packageItem ) { QString packageName( ( static_cast<QCheckListItem*>( packageItem ) )->text() ); // Create package manager output widget PackageInfoDlg *dlg = new PackageInfoDlg( this, &m_packman, packageName ); // Display widget m_widgetStack.addWidget( dlg, 3 ); m_widgetStack.raiseWidget( dlg ); }
void Web::ParseFile(wxString whaturl) { if(whaturl == "/KIKU/packages.txt") { wxString packageName(wxT("MSW")); #if defined(__WXGTK__) packageName = wxT("GTK"); #elif defined(__WXMAC__) packageName = wxT("MAC"); #endif wxArrayString lines = wxStringTokenize(m_dataRead, wxT("\n")); for (size_t i=0; i<lines.GetCount(); i++) { wxString line = lines.Item(i); line = line.Trim().Trim(false); if (line.StartsWith(wxT("#"))) { //comment line continue; } // parse the line wxArrayString tokens = wxStringTokenize(line, wxT("|")); if (tokens.GetCount() > 3) { // find the entry with our package name if (tokens.Item(0).Trim().Trim(false) == packageName) { wxString url = tokens.Item(2).Trim().Trim(false); wxString rev = tokens.Item(1).Trim().Trim(false); wxString releaseNotesUrl = tokens.Item(3).Trim().Trim(false); long currev; long webrev(0); // convert strings to long wxString sCurRev(VERSION); sCurRev.ToLong(&currev); wxString sUrlRev(rev); sUrlRev.ToLong(&webrev); //wxMessageBox(rev); if ( webrev > currev ) { // notify the user that a new version is available //e.SetClientData(new WebJobData(url.c_str(), releaseNotesUrl.c_str(), currev, webrev, false, m_userRequest)); wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, WEB_ID ); event.SetString(url); wxGetApp().AddPendingEvent( event ); //m_pHandler->OnWeb(url, releaseNotesUrl, currev, webrev); } break; } } } } }
/* * Write files to the given output. This implementation does *not* create * a standalone archive suitable for restore on its own. In particular, the identification of * the application's name etc is not in-band here; it's assumed that the calling code has * taken care of supplying that information previously in the output stream. * * The file format is 'tar's, with special semantics applied by use of a "fake" directory * hierarchy within the tar stream: * * apps/packagename/a/Filename.apk - this is an actual application binary, which will be * installed on the target device at restore time. These need to appear first in the tar * stream. * apps/packagename/obb/[relpath] - OBB containers belonging the app * apps/packagename/r/[relpath] - these are files at the root of the app's data tree * apps/packagename/f/[relpath] - this is a file within the app's getFilesDir() tree, stored * at [relpath] relative to the top of that tree. * apps/packagename/db/[relpath] - as with "files" but for the getDatabasePath() tree * apps/packagename/sp/[relpath] - as with "files" but for the getSharedPrefsFile() tree * apps/packagename/c/[relpath] - as with "files" but for the getCacheDir() tree * * and for the shared storage hierarchy: * * shared/[relpaths] - files belonging in the device's shared storage location. This will * *not* include .obb files; those are saved with their owning apps. * * This method writes one file data block. 'domain' is the name of the appropriate pseudo- * directory to be applied for this file; 'linkdomain' is the pseudo-dir for a relative * symlink's antecedent. * * packagename: the package name to use as the top level directory tag * domain: which semantic name the file is to be stored under (a, r, f, db, etc) * linkdomain: where a symlink points for purposes of rewriting; current unused * rootpath: prefix to be snipped from full path when encoding in tar * path: absolute path to the file to be saved * dataOutput: the BackupDataOutput object that we're saving into */ static int backupToTar(JNIEnv* env, jobject clazz, jstring packageNameObj, jstring domainObj, jstring linkdomain, jstring rootpathObj, jstring pathObj, jobject dataOutputObj) { int ret; // Extract the various strings, allowing for null object pointers const char* packagenamechars = (packageNameObj) ? env->GetStringUTFChars(packageNameObj, NULL) : NULL; const char* rootchars = (rootpathObj) ? env->GetStringUTFChars(rootpathObj, NULL) : NULL; const char* pathchars = (pathObj) ? env->GetStringUTFChars(pathObj, NULL) : NULL; const char* domainchars = (domainObj) ? env->GetStringUTFChars(domainObj, NULL) : NULL; String8 packageName(packagenamechars ? packagenamechars : ""); String8 rootpath(rootchars ? rootchars : ""); String8 path(pathchars ? pathchars : ""); String8 domain(domainchars ? domainchars : ""); if (domainchars) env->ReleaseStringUTFChars(domainObj, domainchars); if (pathchars) env->ReleaseStringUTFChars(pathObj, pathchars); if (rootchars) env->ReleaseStringUTFChars(rootpathObj, rootchars); if (packagenamechars) env->ReleaseStringUTFChars(packageNameObj, packagenamechars); // Extract the data output fd BackupDataWriter* writer = (BackupDataWriter*) env->GetIntField(dataOutputObj, sBackupDataOutput.mBackupWriter); // Validate if (!writer) { LOGE("No output stream provided [%s]", path.string()); return -1; } if (path.length() < rootpath.length()) { LOGE("file path [%s] shorter than root path [%s]", path.string(), rootpath.string()); return -1; } return write_tarfile(packageName, domain, rootpath, path, writer); }
QString AndroidManager::intentName(ProjectExplorer::Target *target) { return packageName(target) + QLatin1Char('/') + activityName(target); }