Rev 256 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 256 | Rev 257 | ||
---|---|---|---|
Line 2427... | Line 2427... | ||
2427 | return result; |
2427 | return result; |
2428 | }
|
2428 | }
|
2429 | else return result; //ïîëó÷èëè íå êîððåêòíûé îòâåò |
2429 | else return result; //ïîëó÷èëè íå êîððåêòíûé îòâåò |
2430 | int m; |
2430 | int m; |
2431 | m++; |
2431 | m++; |
2432 | }
|
2432 | }
|
2433 | else { |
2433 | else { |
2434 | wmiThread.terminate(); |
2434 | wmiThread.terminate(); |
2435 | return result; |
2435 | return result; |
2436 | /*********
|
2436 | /*********
|
2437 | wmiThread.stop();
|
2437 | wmiThread.stop();
|
2438 | ok = wmiThread.wait(10000);
|
2438 | ok = wmiThread.wait(10000);
|
2439 | int k;
|
2439 | int k;
|
2440 | k++;
|
2440 | k++;
|
2441 | *******/
|
2441 | *******/
|
- | 2442 | }
|
|
- | 2443 | ||
- | 2444 | ||
- | 2445 | ||
2442 | }
|
2446 | }
|
2443 | 2447 | ||
2444 | 2448 | ||
2445 | 2449 | ||
2446 | 2450 | ||
- | 2451 | QList<TWmiSoundCard> MainWindow::getWmiSoundCard(QString host, QString user_name, QString password) |
|
- | 2452 | {
|
|
- | 2453 | QList<TWmiSoundCard> result; |
|
- | 2454 | TWmiSoundCard soundCard_tmp;
|
|
- | 2455 | bool ok; |
|
- | 2456 | QString ansver_string;
|
|
- | 2457 | wmiThread.setHost(host); // çàäàåì õîñò |
|
- | 2458 | wmiThread.setUser(user_name);//çàäàåì èìÿ ïîëüçîâàòåëÿ |
|
- | 2459 | wmiThread.setPassword( password); |
|
- | 2460 | wmiThread.setWmiString(tr("Select Caption, Name from Win32_SoundDevice")); |
|
- | 2461 | wmiThread.start(QThread::NormalPriority); |
|
- | 2462 | ok = wmiThread.wait(10000); |
|
2447 | 2463 | ||
2448 | 2464 | ||
2449 | 2465 | ||
- | 2466 | if (ok){ |
|
- | 2467 | QTextDocument * wmiDoc = ui->textEdit_2->document(); |
|
- | 2468 | QTextCursor * wmiCursor; |
|
- | 2469 | QStringList split_new_line; // |
|
- | 2470 | QStringList fields_list; //â ýòîì ñïèñêå ñîõðàíèì ïîëÿ |
|
- | 2471 | QStringList values_list; //à â ýòîì ñïèñêå - çíà÷åíèÿ |
|
- | 2472 | wmiCursor = new QTextCursor(wmiDoc); |
|
- | 2473 | ||
- | 2474 | ||
- | 2475 | ansver_string = wmiThread.resultString(); |
|
- | 2476 | ||
- | 2477 | ||
- | 2478 | wmiCursor->insertText(ansver_string); |
|
- | 2479 | split_new_line = ansver_string.split("\n", QString::SkipEmptyParts); // ðàçáèâàåíì îòâåò íà ñòðîêè |
|
- | 2480 | if(split_new_line.count()>2) { |
|
- | 2481 | QString tmp_str;
|
|
- | 2482 | tmp_str = split_new_line.at(1); |
|
- | 2483 | fields_list = tmp_str.split("|"); |
|
- | 2484 | ||
- | 2485 | for(int i=2; i< split_new_line.count(); i++) |
|
- | 2486 | {
|
|
- | 2487 | soundCard_tmp.caption = ""; |
|
- | 2488 | tmp_str = split_new_line.at(i); |
|
- | 2489 | values_list = tmp_str.split("|"); |
|
- | 2490 | int index_tmp; |
|
- | 2491 | index_tmp = fields_list.indexOf(tr("Caption")); // íàèìåíîâàíèå çâóêîâîé êàðòû |
|
- | 2492 | if ((index_tmp!=-1) && (index_tmp < values_list.count())) soundCard_tmp.caption = values_list.at(index_tmp); |
|
- | 2493 | ||
- | 2494 | ||
- | 2495 | result << soundCard_tmp; |
|
- | 2496 | ||
- | 2497 | }; |
|
- | 2498 | ||
- | 2499 | return result; |
|
- | 2500 | }
|
|
- | 2501 | else return result; //ïîëó÷èëè íå êîððåêòíûé îòâåò |
|
- | 2502 | int m; |
|
- | 2503 | m++; |
|
- | 2504 | }
|
|
- | 2505 | else { |
|
- | 2506 | wmiThread.terminate(); |
|
- | 2507 | return result; |
|
- | 2508 | /*********
|
|
- | 2509 | wmiThread.stop();
|
|
- | 2510 | ok = wmiThread.wait(10000);
|
|
- | 2511 | int k;
|
|
- | 2512 | k++;
|
|
- | 2513 | *******/
|
|
- | 2514 | }
|
|
2450 | 2515 | ||
2451 | 2516 | ||
- | 2517 | return result; |
|
2452 | 2518 | ||
2453 | }
|
2519 | }
|
- | 2520 | ||
- | 2521 | ||
- | 2522 | ||
- | 2523 | ||
- | 2524 | ||
- | 2525 | ||
- | 2526 | ||
- | 2527 | ||
- | 2528 | ||
- | 2529 |