please eximine sehemu muhimu ya code yangu.
#include "commandline.h"
#include <iostream>
#include <QMetaObject>
#include "churaio.h"
#include <windows.h> //kwa ajir ya rangi
commandLine::commandLine(QObject *parent) : QObject(parent),ThisBoxDir(new mydir(this)),churaSErver(new QTcpServer(this)),clientMpya(new QTcpSocket(this))
{
NatakaJina = false; //Inasaidia kufanya maamuzi ya kuweka jina la fail au dir
JeImeunganishwa = false;
connect(this,SIGNAL(SIGNALpwd()),ThisBoxDir,SLOT(pwd()));
connect(this,SIGNAL(SIGNALHome()),ThisBoxDir,SLOT(Home()));
connect(this,SIGNAL(SIGNALListOfDrives()),ThisBoxDir,SLOT(ListOfDrives()));
connect(this,SIGNAL(SIGNALrootPath()),ThisBoxDir,SLOT(rootPath()));
connect(this,SIGNAL(SIGNALcd(QString)),ThisBoxDir,SLOT(cd(QString)));
connect(this,SIGNAL(SIGNALcdUp()),ThisBoxDir,SLOT(cdUp()));
connect(this,SIGNAL(SIGNALAppPath()),ThisBoxDir,SLOT(AppPath()));
connect(this,SIGNAL(SIGNALListYaMafileNadirKatikaCurrentDIR()),ThisBoxDir,SLOT(ListYaMafileNadirKatikaCurrentDIR()));
connect(this,SIGNAL(SIGNALTafutaFilePath(QString)),ThisBoxDir,SLOT(TafutaFilePath(QString)));
connect(this,SIGNAL(SIGNALListYaABSOLUTEPATHyaMafileNadirKatikaCurrentDIR()),ThisBoxDir,SLOT(ListYaABSOLUTEPATHyaMafileNadirKatikaCurrentDIR()));
connect(this,SIGNAL(SIGNALFunguaFile(QString)),ThisBoxDir,SLOT(FunguaFile(QString)));
connect(this,SIGNAL(SIGNALSomaFailiAKACat(QString)),ThisBoxDir,SLOT(SomaFailiAKACat(QString)));
connect(this,SIGNAL(SIGNALlistYaMafileNaSize()),ThisBoxDir,SLOT(listYaMafileNaSize()));
connect(this,SIGNAL(SIGNALmkdir(QString)),ThisBoxDir,SLOT(slotmkdir(QString)));
connect(this,SIGNAL(SIGNALmkpath(QString)),ThisBoxDir,SLOT(SlotLmkpath(QString)));
connect(this,SIGNAL(SIGNALremove(QString)),ThisBoxDir,SLOT(SLOTremove(QString)));
connect(this,SIGNAL(SIGNALrename(QString,QString)),ThisBoxDir,SLOT(SLOTrename(QString,QString)));
connect(this,SIGNAL(SIGNALrmdir(QString)),ThisBoxDir,SLOT(SLOTrmdir(QString)));
connect(this,SIGNAL(SIGNALrmpath(QString)),ThisBoxDir,SLOT(SLOTrmpath(QString)));
connect(this,SIGNAL(signalNamba()),ThisBoxDir,SLOT(SLOTNamba()));
connect(this,SIGNAL(SIGnaltempPath()),ThisBoxDir,SLOT(SlottempPath()));
connect(this,SIGNAL(signaSEarchPaths(QString)),ThisBoxDir,SLOT(SlotsPaths(QString)));
connect(this,SIGNAL(SIGnALchurarefresh()),ThisBoxDir,SLOT(sloTchurarefresh()));
///sehemu ya churaServer
connect(churaSErver,SIGNAL(newConnection()),this,SLOT(newconnectionToChuraServer()));
//AnzishaChuraServer();
//naconnect nataka jina
connect(this,SIGNAL(SIGNALNatakaJina()),this,SLOT(SLOTNatakaJina()));
//THENnaconnect ya kupeleka socket
connect(this,SIGNAL(SIGNALpelekaSocket(QTcpSocket*)),ThisBoxDir,SLOT(SLOTchukuaSocket(QTcpSocket*)));
///connection ya rusha thisboxdir
connect(this,SIGNAL(SignalRUSHAThisBoxDir(mydir*)),ThisBoxDir,SLOT(SLOTPOKEAThisBoxDir(mydir*))); //tunaemit singnal yake hapa na kwenye ansisha loop
emit SignalRUSHAThisBoxDir(ThisBoxDir);
}
commandLine::~commandLine()
{
}
void commandLine::anzishaLoopYacommand()
{
emit SignalRUSHAThisBoxDir(ThisBoxDir); //signal nyingine ya rusha
std::string jina,jina2;
for(;
😉{
///rangi
HANDLE edo2 = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(edo2, 3);
std::cout <<"ChuraJasusi";
SetConsoleTextAttribute(edo2, 12);//nyekundu
std::cout << ">: ";
SetConsoleTextAttribute(edo2, 7); //rudisha kwenye nyeupe
std::string comMand;
getLine(std::cin,comMand);
//i take the metadata
QMetaObject metaobj = this->staticMetaObject;
QMetaEnum metaenum = metaobj.enumerator(metaobj.indexOfEnumerator("mycmd"));