Exemplo n.º 1
0
/*
 * Returns a string containing all AUR packages given a searchString parameter
 */
QByteArray UnixCommand::getRemotePackageList(const QString &searchString, bool useCommentSearch)
{
  QByteArray result("");

  if (useCommentSearch)
    result = performQuery("query -Rs " + searchString);
  else
    result = performQuery("query -Rs " + searchString);

  return result;
}
// called from calssifieds, events, groups, land, people, and places
void LLPanelDirBrowser::onClickSearchCore()
{
	resetSearchStart();
	performQuery();

	LLFloaterDirectory::sOldSearchCount++;
}
Exemplo n.º 3
0
/*
 * Returns a string with the list of all packages available in all repositories
 * (installed + not installed)
 *
 * @param pkgName Used while the user is searching for the pkg that provides a certain file
 */
QByteArray UnixCommand::getPackageList(const QString &pkgName)
{
  QByteArray result;

  if (pkgName.isEmpty())
    result = performQuery(QStringList("-Ss"));
  else
  {
    QStringList sl;
    sl << "-Ss";
    sl << pkgName;
    result = performQuery(sl);
  }

  return result;
}
Exemplo n.º 4
0
/*
 * Given a group name, returns a string containing all packages from it
 */
QByteArray UnixCommand::getPackagesFromGroup(const QString &groupName)
{
  QByteArray res =
      performQuery(QString("--print-format \"%r %n\" -Spg " ) + groupName);

  return res;
}
Exemplo n.º 5
0
// virtual
void LLPanelDirBrowser::prevPage()
{
	mSearchStart -= mResultsPerPage;
	childSetVisible("< Prev", mSearchStart > 0);

	performQuery();
}
// virtual
void LLPanelDirBrowser::nextPage()
{
	mSearchStart += mResultsPerPage;
	childShow("< Prev");

	performQuery();
}
Exemplo n.º 7
0
bool NetworkTask::execute() {
    bool val = performQuery();
    if (val) {
        return Task::execute();
    } else {
		return false;
    }
}
// virtual
void LLPanelDirBrowser::prevPage()
{
	mSearchStart -= mResultsPerPage;
	if (LLUICtrl* ctrl = findChild<LLUICtrl>("< Prev"))
		ctrl->setVisible(mSearchStart > 0);

	performQuery();
}
Exemplo n.º 9
0
/*
 * Given a package name, retrieves the list of all targets needed for its removal
 */
QByteArray UnixCommand::getTargetRemovalList(const QString &pkgName, const QString &removeCommand)
{
  QString args;
  args = "-" + removeCommand + "p " + pkgName;

  QByteArray res = performQuery(args);
  return res;
}
Exemplo n.º 10
0
/*
 * Returns a string with the list of all packages available in all repositories
 * (installed + not installed)
 *
 * @param pkgName Used while the user is searching for the pkg that provides a certain file
 */
QByteArray UnixCommand::getPackageList(const QString &pkgName)
{
  QByteArray result;

  if (pkgName.isEmpty())
  {
#ifdef UNIFIED_SEARCH
    result = performQuery("query -Rs -");
#else
    result = performQuery("query -l");
#endif
  }
  else
  {
  }

  return result;
}
Exemplo n.º 11
0
/*
 * Retrieves the list of targets needed to update the entire system or a given package
 */
QByteArray UnixCommand::getTargetUpgradeList(const QString &pkgName)
{
  QString args;
  QByteArray res = "";

  if(!pkgName.isEmpty())
  {
    args = "install -n -f -Rs " + pkgName;
    res = performQuery(args);
  }
  else //pkg upgrade
  {
    args = "install -un";
    res = performQuery(args);
  }

  return res;
}
Exemplo n.º 12
0
/*
 * Given a package name, returns a string containing all the files inside it
 */
QByteArray UnixCommand::getPackageContentsUsingPacman(const QString& pkgName)
{
  QStringList args;
  args << "-Ql";
  args << pkgName;

  QByteArray res = performQuery(args);
  return res;
}
Exemplo n.º 13
0
/*
 * Given a package name, retrieves the list of all targets needed for its removal
 */
QByteArray UnixCommand::getTargetRemovalList(const QString &pkgName)
{
  QString args;
  QByteArray res = "";

  if(!pkgName.isEmpty())
  {
    args = "remove -R -n " + pkgName;
    res = performQuery(args);
  }

  return res;
}
Exemplo n.º 14
0
/*
 * Given a package name and if it is default to the official repositories,
 * returns a string containing all of its information fields
 * (ex: name, description, version, dependsOn...)
 */
QByteArray UnixCommand::getPackageInformation(const QString &pkgName, bool foreignPackage = false)
{
  QStringList args;

  if(foreignPackage)
    args << "-Qi";
  else
    args << "-Si";

  if (pkgName.isEmpty() == false) // enables get for all ("")
    args << pkgName;

  QByteArray result = performQuery(args);
  return result;
}
Exemplo n.º 15
0
/*
 * Retrieves the list of targets needed to update the entire system or a given package
 */
QByteArray UnixCommand::getTargetUpgradeList(const QString &pkgName)
{
  QString args;

  if(!pkgName.isEmpty())
  {
    args = "--print-format \"%n %v %s\" -Sp " + pkgName;
  }
  else
  {
    args = "--print-format \"%n %v %s\" -Spu";
  }

  QByteArray res = performQuery(args);
  return res;
}
Exemplo n.º 16
0
/*
 * Given a complete file path, returns the package that provides that file
 */
QString UnixCommand::getPackageByFilePath(const QString &filePath)
{
  QStringList sl;
  sl << "-Qo";
  sl << filePath;

  QString out = performQuery(sl);
  QStringList s = out.split("\n", QString::SkipEmptyParts);

  if (s.count() >= 1)
  {
    QStringList res = s.at(0).split(" ", QString::SkipEmptyParts);
    return res.at(res.count()-2);
  }
  else return "";
}
Exemplo n.º 17
0
GenericLookupDialog::GenericLookupDialog( QWidget * parent ):
    QDialog(parent)
{
    addAction(MainWindow::instance()->action(MainWindow::LookupDocumentationForCursor));

    mQueryEdit = new QLineEdit(this);

    mResult = new QTreeView(this);
    mResult->setRootIsDecorated(false);
    mResult->setAllColumnsShowFocus(true);
    mResult->setHeaderHidden(true);
    mResult->header()->setStretchLastSection(false);
  
    mPreviewDocument = new Document(false);
    mPreviewEditor = new ScCodeEditor(mPreviewDocument);
    mPreviewEditor->setReadOnly(true);
    mPreviewEditor->setVisible(false);
    mPreviewEditor->setTabChangesFocus(true);
  
    QVBoxLayout *layout = new QVBoxLayout;
    layout->setContentsMargins(0,0,0,0);
    layout->setSpacing(1);
    layout->addWidget(mQueryEdit, 0);
    layout->addWidget(mResult, 2);
    layout->addWidget(mPreviewEditor, 1);
  
    setLayout(layout);

    connect(mQueryEdit, SIGNAL(returnPressed()), this, SLOT(performQuery()));
    connect(mResult, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(onAccepted(QModelIndex)));
    connect(mResult, SIGNAL(activated(QModelIndex)),     this, SLOT(onAccepted(QModelIndex)));

    mResult->installEventFilter(this);

    QRect bounds(0,0,600,300);
    if (parent) {
        QRect parentRect = parent->rect();
        bounds.moveCenter( parent->mapToGlobal( parentRect.center() ) );
    } else {
        QRect availableBounds = QApplication::desktop()->availableGeometry(this);
        bounds.moveCenter( availableBounds.center() );
    }

    setGeometry(bounds);

    mQueryEdit->setFocus( Qt::OtherFocusReason );
}
Exemplo n.º 18
0
/*
 * Given a package name and if it is default to the official repositories,
 * returns a string containing all of its information fields
 * (ex: name, description, version, dependsOn...)
 */
QByteArray UnixCommand::getPackageInformation(const QString &pkgName, bool foreignPackage = false)
{
  QString args;

  if(foreignPackage)
  {
  }
  else
  {
    args = "query " + pkgName;
  }

  //if (pkgName.isEmpty() == false) // enables get for all ("")
  //  args << pkgName;

  QByteArray result = performQuery(args);
  return result;
}
Exemplo n.º 19
0
/*
 * Given a complete file path, returns the package that provides that file
 */
QString UnixCommand::getPackageByFilePath(const QString &filePath)
{
  QString pkgName="";
  QString out = performQuery("query -o " + filePath);

  if (!out.isEmpty())
  {
    int pos = out.indexOf(":");
    if (pos != -1)
    {      
      pkgName = out.left(pos);
      //Now we have to remove the pkg version...
      int dash = pkgName.lastIndexOf("-");
      if (dash != -1)
      {
        pkgName = pkgName.left(dash);
      }
    }
  }

  return pkgName;
}
Exemplo n.º 20
0
/*
 * Returns a string containing all packages no one depends on
 */
QByteArray UnixCommand::getUnrequiredPackageList()
{
  QByteArray result = performQuery("query -m");
  return result;
}
void LLPanelDirEvents::onClickToday()
{
	resetSearchStart();
	setDay(0);
	performQuery();
}
Exemplo n.º 22
0
/*
 * Returns a string containing all packages that are not contained in any repository
 * (probably the ones installed by a tool such as yaourt)
 */
QByteArray UnixCommand::getForeignPackageList()
{
  QByteArray result = performQuery(QStringList("-Qm"));
  return result;
}
Exemplo n.º 23
0
/*
 * Returns a string containing all packages that are outdated since last DB sync
 */
QByteArray UnixCommand::getOutdatedPackageList()
{
  //QByteArray result = "qt5-x11extras-5.5.0_2 update x86_64 http://repo.voidlinux.eu/current\nqtchooser-52_1 update x86_64 http://repo.voidlinux.eu/current\nrtkit-0.11_12 update x86_64 http://repo.voidlinux.eu/current\nsudo-1.8.14p3_1 update x86_64 http://repo.voidlinux.eu/current";
  QByteArray result = performQuery("install -un");
  return result;
}
Exemplo n.º 24
0
/*
 * Retrieves the remote dependencies pkg list
 */
QByteArray UnixCommand::getRemoteDependenciesList(const QString &pkgName)
{
  QByteArray result = performQuery("query -Rx " + pkgName);
  return result;
}
Exemplo n.º 25
0
/*
 * Given a package name, returns a string containing all the files inside it
 */
QByteArray UnixCommand::getPackageContentsUsingPacman(const QString& pkgName)
{
  QByteArray res = performQuery("query -f " + pkgName);
  return res;
}
void LLPanelDirEvents::onBackBtn()
{
	resetSearchStart();
	setDay(mDay - 1);
	performQuery();
}
Exemplo n.º 27
0
/*
 * Retrieves the given field for a remote package search
 */
QByteArray UnixCommand::getFieldFromRemotePackage(const QString &field, const QString &pkgName)
{
  QByteArray res = performQuery("query -R -p " + field + " " + pkgName);
  return res;
}
Exemplo n.º 28
0
/*
 * Retrieves the list of installed packages in a special format for TargetList
 */
QByteArray UnixCommand::getInstalledPackages()
{
  QString args = "query '%n-%v %n#%v";
  QByteArray res = performQuery(args);
  return res;
}
void LLPanelDirEvents::onForwardBtn()
{
	resetSearchStart();
	setDay(mDay + 1);
	performQuery();
}
Exemplo n.º 30
0
/*
 * Retrives the list of package groups
 */
QByteArray UnixCommand::getPackageGroups()
{
  QByteArray res = performQuery(QStringList("-Sg"));
  return res;
}