⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 controller.cpp

📁 程序代码使用说明: (1)所有源代码目录下都提供了Makefile(非Qt)
💻 CPP
字号:
#include "Controller.h"#include "AppMgrModel.h"#include "MainWin.h"#include <QString>#include <unistd.h>#include <sys/types.h>void Controller::showTopScreen(){    showNext(Folder_Type, TOP_FOLDER_FLAG, NULL);}void Controller::showNext(int type, const QString& value, MainWin* preWin){    switch (type)    {    case Folder_Type:        {            MainWin* mainWin = new MainWin(value, preWin);            mainWin->show();                        if (preWin)                preWin->hide();            return;        }    case Application_Type:        {            launchApp(value.toUtf8().constData());            return;        }    default:        return;    }}void Controller::launchApp(const char* fileName){    if (fileName == NULL)    {        qCritical("Launch path is NULL!\n");    }        pid_t pid = fork();    if (pid == 0)    {        qDebug("new process forked. PID is:%d\n", getpid());        int result = execl(fileName, fileName, 0);        if (result < 0)        {            qCritical("failed to launch application!\n");        }        _exit(-1);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -