MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / SaveProfileAs

Method SaveProfileAs

qt/OpenRGBDialog2/OpenRGBDialog2.cpp:1743–1774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1741}
1742
1743void OpenRGBDialog2::SaveProfileAs()
1744{
1745 ProfileManager* profile_manager = ResourceManager::get()->GetProfileManager();
1746
1747 if(profile_manager != NULL)
1748 {
1749 OpenRGBProfileSaveDialog dialog;
1750
1751 /*---------------------------------------------------------*\
1752 | Open Profile Name Dialog |
1753 \*---------------------------------------------------------*/
1754 std::string profile_name = dialog.show();
1755
1756 if(!profile_name.empty())
1757 {
1758 /*---------------------------------------------------------*\
1759 | Extension .orp - OpenRgb Profile |
1760 \*---------------------------------------------------------*/
1761 std::string filename = profile_name;
1762
1763 /*---------------------------------------------------------*\
1764 | Save the profile |
1765 \*---------------------------------------------------------*/
1766 if(profile_manager->SaveProfile(filename))
1767 {
1768 UpdateProfileList();
1769
1770 ui->ProfileBox->setCurrentIndex(ui->ProfileBox->findText(QString::fromStdString(profile_name)));
1771 }
1772 }
1773 }
1774}
1775
1776void Ui::OpenRGBDialog2::on_ButtonRescan_clicked()
1777{

Callers

nothing calls this directly

Calls 5

GetProfileManagerMethod · 0.80
getFunction · 0.50
showMethod · 0.45
emptyMethod · 0.45
SaveProfileMethod · 0.45

Tested by

no test coverage detected